0% found this document useful (0 votes)
1 views20 pages

Good Samaritan Samaritan School School

Uploaded by

herorehan6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views20 pages

Good Samaritan Samaritan School School

Uploaded by

herorehan6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

GOOD SAMARITAN SCHOOL

COMPUTER SCIENCE PROJECT ON CAR


MANAGEMENT SYSTEM

MADE BY:--
NAME: Sachin Kumar
ROLL NO. : 27
INDEX

S.No. TOPIC PAGE


NO.

CERTIFICATE 3
1.
2. ACKNOWLEDGEMENT 4

3. OBJECTIVE OF THE PROJECT 5

4. HARDWARE AND SOFTWARE 6


REQUIREMENTS

5. CODING 7-13

6. OUTPUT 14-19

7. BIBLIOGRAPHY 20

(ii)
CERTIFICATE
This is to certify that Sachin Kumar of Class XII-A of
Good Samaritan School, JASOLA VIHAR has
successfully completed his project on
“CAR MANAGEMENT SYSTEM” as prescribed by
CBSE.

DATE:

ROLL NO. :

SIGNATURE SIGNATURE
(INTERNAL EXAMINER) (EXTERNAL EXAMINER)

(3)
ACKNOWLEDGEMENT

It would be my utmost pleasure to thank my


COMPUTER SCIENCE Teacher Mr. John Major
for giving me this knowledgeable topic “CAR
MANAGEMENT SYSTEM” and guiding me
during the course of the project.

(4)
OBJECTIVE OF THE PROJECT

This project deals with the details of Cars of different


company moreover this project is enabled to interact with
the user and work on the data in the table “CARS”.
Following are the functionalities of the project:-
1) READING OF DATA
2) WRITING OF DATA
3) SEARCHING OF DATA
4) UPDATION OF DATA
5) DELETION OF DATA

DESCRIPTION OF THE TABLE:-

(5)
HARDWARE AND SOFTWARE
REQUIREMENTS

1) PROCESSOR: Intel(R) Core(TM) i7-4600U CPU @


2.10GHz 2.69 GHz, 64-bit operating
system, x64-based processor

2) DISK SPACE: 12GB RAM AND 256GB SPACE

3) OPERATING SYSTEM: Windows

4) MYSQL: VERSION 8.0.32

5) PYTHON: THONNY VERSION 4.0.2

(6)
CODING
Import mysql.connector as sqltor
mycon=sqltor.connect(host="localhost",user="root",passwd="",charset='utf8',d
atabase="Hindustan_Motors")
if mycon.is_connected():
print("successfully connected")

ch="y"
whilech=='y' or ch=='Y':
print("=======MENU=========")
print("1. Reading the data")
print("2. Writing the data")
print("3. Searching the data")
print("4. Updating the data")
print("5. Deleting the data")
c=int(input("Enter your choice: "))

if c==1:
cursor=mycon.cursor()
cursor.execute("select * from cars")
data=cursor.fetchall()
count=cursor.rowcount
print("=====================")

(7)
print('Total number of rows retrieved: ',count)
for row in data:
print(row)

elif c==2:
company=input('Enter Company of the car: ')
model=input('Enter Model of the car: ')
year=input('Enter Launch year of the car: ')
origin=input('Enter Origin of the car: ')
horsepower= input('Enter horsepower of the car: ')
manuf=int(input('Enter manufacturing id: '))
write="INSERT INTO CARS(Company, Model, Launch_Year, Origin,
Horsepower,manuf_id)VALUES('{}','{}',{},'{}',{},{})".format
(company,model, year,origin,horsepower,manuf)
cursor=mycon.cursor()
cursor.execute(write)
mycon.commit()
print("======INSERTED======")

(8)
elif c==3:
b="y"
while b=='y' or b=='Y':
print('========================')
print("1. Using Company")
print("2. Using Model")
print("3. Using manufacturing id")
x=int(input("Enter your choice: "))
if x==1:
cursor=mycon.cursor()
cursor.execute("select * from cars")
data=cursor.fetchall()
comp=input('enter company: ')
for row in data:
if comp in row:
print(row)
elif x==2:
cursor=mycon.cursor()
cursor.execute("select * from cars")
data=cursor.fetchall()
model=input('enter model: ')
for row in data:
if model in row:
print(row)

(9)
elif x==3:
cursor=mycon.cursor()
cursor.execute("select * from cars")
data=cursor.fetchall()
manuf=int(input('enter manufacturing id: '))
for row in data:
if manuf in row:
print(row)
else:
print('INVALID CHOICE')
b=input("Do You Want To search More(Y/N): ")
elif c==4:
a="y"
while a=='y' or a=='Y':
print('========================')
print("1. Update Company")
print("2. Update Model")
print("3. Update Launch Year")
print("4. Update Origin")
print("5. Update Horsepower")
print("6. Update manufacturing id")
x=int(input("Enter your choice: "))

(10)
if x==1:
manuf=int(input('Enter Manufacturing ID for updating: '))
new=input('enter new company: ')
up=”update cars set company={} where manuf_id={}”
.format(new,manuf)
cursor=mycon.cursor()
cursor.execute(up)
mycon.commit()
print('UPDATED')
elif x==2:
manuf=int(input('Enter Manufacturing ID for
updating: '))
new=input('Enter New Model: ')
up=”update cars set model={} where
manuf_id={}”.format(new,manuf)
cursor=mycon.cursor()
cursor.execute(up)
mycon.commit()
print('UPDATED')
elif x==3:
manuf=int(input('enter manufacturing for updating: '))
new=int(input('enter new year: '))
up=”update cars set launch_year={} where
manuf_id={}”.format(new,manuf)
cursor=myco(1n1.)cursor()
cursor.execute(up)
mycon.commit()
print('UPDATED')
elif x==4:
manuf=int(input('enter manufacturing for updating: '))
new=input('enter new origin: ')
up='update cars set origin={} where
manuf_id={}'.format(new,manuf)
cursor=mycon.cursor()
cursor.execute(up)
mycon.commit()
print('UPDATED')
elif x==5:
manuf=int(input('enter manufacturing for updating: '))
new=input('enter new horsepower: ')
up='update cars set horsepower={} where
manuf_id={}'.format(new,manuf)
cursor=mycon.cursor()
cursor.execute(up)
mycon.commit()
print('UPDATED')

(12)
elif x==6:
manuf=int(input('enter manufacturing for updating: '))
new=input('enter new manufacturing code: ')
up='update cars set manuf_id={} where
manuf_id={}'.format(new,manuf)
cursor=mycon.cursor()
cursor.execute(up)
mycon.commit()
print('UPDATED')
else:
print('INVALID CHOICE')
a=input("Do You Want To Update More(Y/N): ")
elif c==5:
manuf=input('enter manufacturing id of which row is to be deleted: ')
delete="delete from cars where manuf_id={}".format(manuf)
cursor=mycon.cursor()
cursor.execute(delete)
mycon.commit()
print('Deleted')
else:
print("Invalid Choice")

ch=input("Do you want to continue?(Y/N): ")

(13)
OUTPUT
1) READING DATA

2) WRITING DATA

(14)
3) SEARCHING DATA

(i) Searching using Company

(ii) Searching using Model

(iii) Searching using Manufacturing ID

(15)
4) UPDATING DATA

(i) UPDATING COMPANY:

(16)
(ii) UPDATING MODEL:

(iii) UPDATING LAUNCH YEAR:

(17)
(iv) UPDATING ORIGIN:

(v) UPDATING HORSEPOWER:

(18)
(vi) UPDATING MANUFICTURING ID:

5) DELETING DATA

(19)
BIBLIOGRAPHY

1) NCERT TEXTBOOK

2) COMPUTER SCIENCE WITH PYTHON TEXTBOOK


BY SUMITA ARORA

(20)

You might also like