BY-
ARYAN SACHAN
ROLL NO.3
SCH NO.5836
CLASS 12A
CERTIFICATE
Certified that the work contained in the project titled
“CAR RENTAL SYSTEM”, by “Aryan Sachan”
Has been carried out under my supervision and that this
work has not been submitted elsewhere for a CBSE
certificate.
Internal Examiner:
External Examiner:
ACKNOWLEDGEMENT
We would like to thank Mr. Rakesh Upadhyay, Principal
Puranchandra Vidyaniketan.
We are deeply indebted to our mentor Mr Sumit Shrivastava.
We further thank to all the staff members of Puranchandra
Vidyaniketan.
We owe our sincere gratitude towards Puranchandra
Vidyaniketan
Our heartfelt thanks to CBSE.
We also express our deepest gratitude to our parents.
Finally, we would like to wind up by paying our heartfelt
thanks to all our near and dear ones.
1. ARYAN
CONTENTS
1. Introduction of the Project.
2. System Requirements of the Project.
3. Python Coding.
4. Output of the Project.
5. References.
INTRODUCTION OF THE
PROJECT
We the students of CLASS XII C of PURANCHANDRA
VIDYANKETAN have been assigned the work of “CAR RENTAL
PROJECT”.
To perform this task the students were divided into the group of
two students named as AKSHAT and YUVRAJ. AKSHAT is assigned
the work of coding of program while the other group member
YUVRAJ was assigned the work of analysing the program and lead
the program to the conclusion.
THE PROJECT STARTS WITH –
Enter User ID:
Enter User Name:
Enter Password:
THEN-
Press 1 - Add a User
Press 2 - Delete a User
Press 3 - Add a New Car
Press 4 - Search for a Car
Press 5 - Delete a Car
Press 6 - Show all Cars
Press 7 - Add a New Member
Press 8 - Search for a Member
Press 9 - Delete a Member
Press 10 - Show all Members
Press 11 - Book a Car
Press 12 - Return a Car
Press 13 - Show all Booked Cars
Press 14 - Delete a Booked Car
Press 15 - To View Charts
Press 16 - To Exit
Enter your choice:
We are so glad that this work has been assigned to us, yet we
haven’t done this work before Mr. Sumit Shrivastava our subject
teacher has also helped us a lot to complete this project.
We have learnt all this work with the help of our sir, we are also
thankful to our respected principal Mr. Rakesh Upadhyay for
providing us various facilities to complete this project.
As we are the students of CLASS XII C and we haven’t done this type
of project before, we have performed all that which we have learnt
from o u r C B S E P R O G R A M M I N G . Hence, w e k n o w
that t h i s programming would be further done on a big platform.
Since we have started this programming from OCTOBER 2024 month,
we believe that this programming would further help us a lot in our
future.
We are also thankful to our group mates for cooperating with each
other while performing this task we have also polished the skills of
group activity.
PROCESS
FIRSTLY, we have done the planning in a paper work regarding
what have to do on the assigned project “CAR RENTAL SYSTEM”.
SECONDLY, we discussed our planning with our subject teacher
and then he provided us the right path to perform the work.
NEXT, we started our project on foot paths of our subject teacher.
THEN, we started our coding, coding took around 2 and half
months for completion.
NEXT, we analysed the mistakes done and then we corrected
them. THEN, we prepared the project format as shown above.
THANKS TO ALL OF WORTHY TEACHERS AND
PRINCIPAL AND MY DEAR GROUP MATES, ALSO
A GREAT THANKS TO PURANCHANDRA
VIDYANIKETAN FOR PROVIDING US THIS
GOLDEN OPPORTUNITY …………
SYSTEM REQUIREMENTS OF THE
PROJECT
Recommended System Requirements
Processors: Intel® Core™ i3 processor 4300M at 2.60 GHz.
Disk space: 2 to 4 GB.
Operating systems: Windows® 10, MACOS, and UBUNTU.
Python Versions: 3.X.X or Higher.
Minimum System Requirements
Processors: Intel Atom® processor or Intel® Core™ i3 processor. Disk
space: 1 GB.
Operating systems: Windows 7 or later, MACOS, and UBUNTU.
Python Versions: 2.7.X, 3.6.X.
Prerequisites before installing MySQL Connector Python
You need root or administrator privileges to perform the installation
process.
Python must be installed on your machine.
Note: – MySQL Connector Python requires python to be in the
system’s PATH. Installation fails if it doesn’t find Python.
On Windows, If Python doesn’t exist in the system’s PATH, please
manually add the directory containing python.exe yourself.
PYTHON CODING
import pandas as pd
import matplotlib.pyplot as plt
from datetime import date
print("---------------------------WELCOME TO LUXURY CAR RENTALS---------------------------")
def addUser():
uid = input("Enter User ID:")
uname = input("Enter User Name:")
pwd = input("Enter Password:")
udf = pd.read_csv("Users.csv")
print(udf)
n = udf['User ID'].count()
print(n)
udf.loc[n,:] = [uid, uname, pwd]
print(udf)
udf.to_csv("Users.csv")
print("User added successfully")
print(udf)
def deleteUser():
uid = input("Enter a User ID:")
udf = pd.read_csv("Users.csv")
udf = udf.drop(udf[udf["User ID"] == uid].index)
udf.to_csv("Users.csv")
print("User deleted successfully")
print(udf)
def addNewCar():
carno = int(input("Enter a Car Number:"))
carname = input("Enter Name of the Car:")
brand = input("Enter brand of the Car:")
branch = input("Enter branch:")
fueltype = input("Enter fuel type of the car:")
cost = int(input("Enter cost of rent per day:"))
category = input("Enter category of the car:")
cdf = pd.read_csv("Cars.csv")
n = cdf["Car No."].count()
cdf.loc[n] = [carno, carname, brand, branch, fueltype, cost, category]
cdf.to_csv("Cars.csv", index=False)
print("Car added successfully!")
def searchCar():
carname = input("Enter a Car name:")
cdf = pd.read_csv("Cars.csv")
df = cdf.loc[cdf["Car Name"] == carname]
if df.empty:
print("No cars found with the given code")
else:
print("Car details are:")
print(df)
def deleteCar():
carno = float(input("Enter a car number:"))
cdf = pd.read_csv("Cars.csv")
cdf = cdf.drop(cdf[cdf["Car No."] == carno].index)
cdf.to_csv("Cars.csv", index=False)
print("Car Deleted Successfully")
print(cdf)
def showCars():
cdf = pd.read_csv("Cars.csv")
print(cdf)
def addNewMember():
mid = int(input("Enter a member id:"))
mname = input("Enter member name:")
phoneno = int(input("Enter phone number:"))
numberofcarsbooked = 0
mdf = pd.read_csv("Members.csv")
n = mdf["MID"].count()
mdf.loc[n] = [mid, mname, phoneno, numberofcarsbooked]
mdf.to_csv("Members.csv", index=False)
print("New Member added successfully!")
print(mdf)
def searchMember():
mname = input("Enter a member name:")
mdf = pd.read_csv("Members.csv")
df = mdf.loc[mdf["M Name"] == mname]
if df.empty:
print("No members found with the given name")
else:
print("Member details are:")
print(df)
def deleteMember():
mid = float(input("Enter a member id:"))
mdf = pd.read_csv("Members.csv")
mdf = mdf.drop(mdf[mdf["MID"] == mid].index)
mdf.to_csv("Members.csv", index=False)
print("Member deleted successfully")
print(mdf)
def showMembers():
mdf = pd.read_csv("Members.csv")
print(mdf)
def bookCar():
carname = input("Enter car name:")
cdf = pd.read_csv("Cars.csv")
cdf = cdf.loc[cdf["Car Name"] == carname]
if cdf.empty:
print("No Car found in the records")
return
mname = input("Enter member name:")
mdf = pd.read_csv("Members.csv")
mdf = mdf.loc[mdf["M Name"] == mname]
if mdf.empty:
print("No such Member found")
return
dateofbooking = input("Enter date of booking:")
numberofdays = int(input("Enter the number of days booked:"))
print("^" * 40)
print(" BILL GENERATED ")
print("^" * 40)
print("Car Rented ",carname)
print("Name of Member ",mname)
print("Cost per Day ",cdf["Cost"])
total_cost = numberofdays * cdf["Cost"]
print("Total Rental Cost ",total_cost)
print("^" * 40)
k = input("Press C to continue")
bdf = pd.read_csv("Cars Booked.csv")
n = bdf["Car Name"].count()
bdf.loc[n] = [carname, mname, dateofbooking, numberofdays,total_cost, ""]
bdf.to_csv("Cars Booked.csv", index=False)
print("Car booked successfully")
print(bdf)
def returnCar():
mname = input("Enter a member name:")
carname = input("Enter car name:")
rdf = pd.read_csv("Cars Booked.csv")
rdf = rdf.loc[rdf["Car Name"] == carname]
if rdf.empty:
print("The car is not booked in records")
else:
rdf = rdf.loc[rdf["M Name"] == mname]
if rdf.empty:
print("The car is not booked by the member")
else:
print("Car can be returned")
ans = input("Are you sure you want to return the car:")
if ans.lower() == "yes":
rdf = pd.read_csv("Cars Booked.csv")
rdf = rdf.drop(rdf[rdf["Car Name"] == carname].index)
rdf.to_csv("Cars Booked.csv", index=False)
print("Car returned successfully")
else:
print("Return operation cancelled")
def showbookedCars():
rdf = pd.read_csv("Cars Booked.csv")
print(rdf)
print("^" * 50)
print("Car Name\tMember Name\tBill Amount")
for r in rdf.iterrows():
print(r[1]["Car Name"]+"\t"+r[1]["M Name"])
print("^" * 50)
def deletebookedCars():
carname = input("Enter a car name:")
bdf = pd.read_csv("Cars Booked.csv")
bdf = bdf.drop(bdf[bdf["Car Name"] == carname].index)
bdf.to_csv("Cars Booked.csv", index=False)
print("Deleted Booked cars successfully")
print(bdf)
def showCharts():
print("Press 1 - Cars and their Rental Cost")
print("Press 2 - Number of Cars booked by members")
ch = int(input("Enter your choice:"))
if ch == 1:
df = pd.read_csv("Cars.csv")
df = df[["Car Name", "Cost"]]
df.plot("Car Name", "Cost", kind="bar")
plt.xlabel("carname------>")
plt.ylabel("cost------>")
plt.show()
if ch == 2:
df = pd.read_csv("Cars Booked.csv")
df = df[["No. of cars Booked", "M Name"]]
df.plot(kind="bar", color="red")
plt.show()
def login():
uid = input("Enter User ID:")
uname = input("Enter User Name:")
pwd = input("Enter Password:")
df = pd.read_csv("Users.csv")
df = df.loc[df["User ID"] == uid]
if df.empty:
print("Invalid User ID given")
return False
else:
df = df.loc[df["User Name"] == uname]
if df.empty:
print("Invalid User Name given")
return False
else:
df = df.loc[df["Password"] == pwd]
if df.empty:
print("Invalid password")
return False
else:
print("Username and Password matched successfully")
return True
def showMenu():
print("----------------------------------------------------------------------------------------")
print(" LUXURY CAR RENTALS ")
print("----------------------------------------------------------------------------------------")
print("Press 1 - Add a User")
print("Press 2 - Delete a User")
print("Press 3 - Add a New Car")
print("Press 4 - Search for a Car")
print("Press 5 - Delete a Car")
print("Press 6 - Show all Cars")
print("Press 7 - Add a New Member")
print("Press 8 - Search for a Member")
print("Press 9 - Delete a Member")
print("Press 10 - Show all Members")
print("Press 11 - Book a Car")
print("Press 12 - Return a Car")
print("Press 13 - Show all Booked Cars")
print("Press 14 - Delete a Booked Car")
print("Press 15 - To View Charts")
print("Press 16 - To Exit")
choice = int(input("Enter your choice:"))
return choice
if login():
while True:
ch = showMenu()
if ch == 1:
addUser()
elif ch == 2:
deleteUser()
elif ch == 3:
addNewCar()
elif ch == 4:
searchCar()
elif ch == 5:
deleteCar()
elif ch == 6:
showCars()
elif ch == 7:
addNewMember()
elif ch == 8:
searchMember()
elif ch == 9:
deleteMember()
elif ch == 10:
showMembers()
elif ch == 11:
bookCar()
elif ch == 12:
returnCar()
elif ch == 13:
showbookedCars()
elif ch == 14:
deletebookedCars()
elif ch == 15:
showCharts()
elif ch == 16:
break
else:
print("Invalid Option Selected")
print("THANK YOU FOR VISITING LUXURY CAR RENTALS")
OUTPUT
SCREENS
FIRST SCREEN-
ADD USER-
DELETE USER-
ADD A NEW CAR-
SEARCH FOR A CAR-
DELETE A CAR-
SHOW ALL CARS-
ADD NEW MEMBER-
SEARCH FOR A MEMBER-
DELETE A MEMBER-
SHOW ALL MEMBERS-
BOOK A CAR-
RETURN A CAR-
SHOW ALL BOOKED CARS-
DELETE A BOOKED CAR-
TO VIEW CHARTS-
CSV FILES
CARS BOOKED-
CARS-
MEMBERS-
USERS-
REFERENCES
In order to work on this project titled “CAR RENTAL SYSYEM”, the following
books and literature are referred by me during the various phases of
development of the project.
(1) The Complete Reference python
-by Shildit
2. MySQL, Black Book
-by Steven Holzner
(2) Understanding SQL
– Gruber
(3) http://www.mysql.org/
(4) Course Book for class XII
(5) Together with Informatics Practices
(6) Various Websites of Discussion Forum and software development activities.
Other than the above-mentioned books, the suggestions and supervision of my
teacher and
my class experience also helped me to develop this software project.
Bibliography
1. www.wikipedia.com
2. www.slideshare.net
3. www.geeksforgeeks.org
4. www.google.com
5. Computer Science with Python by Sumita Arora Class XIIth (Book)