Cs Project - 12 Converted by Abcdpdf
Cs Project - 12 Converted by Abcdpdf
Cs Project - 12 Converted by Abcdpdf
SCHOOL
INDEX
ACKNOWLDEGEMENT 4
INTRODUCTION 5
FEATURES 6
HARDWARE USED 9
SOFTWARE USED 10
SYSTEM STRUCTURE 11
DATABASE STRUCTURE 12
OUTPUT SCREENSHOTS 15
PROGRAM / CODE 20
ANNEXURE 28
BIBLIOGRAPHY 29
Class XII ARNAV JAIN 2021-22
CERTIFICATE
ACKNOWLEDGEMENT
INTRODUCTION
FEATURES
VALIDATION AND
CHECKS
The try and except block in Python is used to catch and handle
exceptions. Python executes code following the try statement
as a “normal” part of the program. The code that follows
the except statement is the program’s response to any exceptions
in the preceding try clause.
HARDWARE USED
Device Specifications
SYSTEM STRUCTURE
DATABASE STRUCTURE
MAIN
Class XII ARNAV JAIN 2021-22
Class XII ARNAV JAIN 2021-22
Class XII ARNAV JAIN 2021-22
OUTPUT SCREENSHOTS
MAIN SCREEN
USER AUTHENTICATION
Class XII ARNAV JAIN 2021-22
BOOKING
RECORD
RESTAURANT
BILL
Class XII ARNAV JAIN 2021-22
GAMING
BILL
FASHION
STORE
BILL
Class XII ARNAV JAIN 2021-22
CUSTOMER
DETAILS
TOTAL
BILL
Class XII ARNAV JAIN 2021-22
OLD BILL
EXIT
Class XII ARNAV JAIN 2021-22
CODE
import mysql.connector
myConnection=mysql.connector.connect(host="localhost",user=userName,passwd=password
, database="HMS" , auth_plugin='mysql_native_password' ) if myConnection:
return myConnection
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
myConnection.close()
if myConnection: cursor=myConnection.cursor()
createTable ="""CREATE TABLE IF NOT EXISTS C_DETAILS(CID VARCHAR(20),C_NAME
VARCHAR(30),C_ADDRESS VARCHAR(30),C_AGE VARCHAR(30),
C_COUNTRY VARCHAR(30) ,P_NO VARCHAR(30),C_EMAIL VARCHAR(30))"""
cursor.execute(createTable)
def roomRent():
global cid
customer=searchCustomer() if
customer:
global roomrent if
myConnection:
cursor=myConnection.cursor()
createTable ="""CREATE TABLE IF NOT EXISTS ROOM_RENT(CID
VARCHAR(20),ROOM_CHOICE INT,NO_OF_DAYS INT,ROOMNO INT ,ROOMRENT INT)”””
cursor.execute(createTable)
print ("\n ##### We have The Following Rooms For You #####") print (" 1. Ultra Royal ----
> 10000 Rs.")
print (" 2. Royal ----> 5000 Rs. “)
print (" 3. Elite -- 3500 Rs. “) print (" 4. Budget --
2500 Rs. “)
roomchoice =int(input("Enter Your Option : "))
roomno=int(input("Enter Customer Room No : "))
def Gaming():
global cid
customer=searchCustomer() if
customer:
global gamingbill if
myConnection:
cursor=myConnection.cursor()
createTable ="""CREATE TABLE IF NOT EXISTS GAMING(CID VARCHAR(20),GAMES
VARCHAR(30),HOURS VARCHAR(30),GAMING_BILL VARCHAR(30)) """
cursor.execute(createTable) print("""
1. Table Tennis -- 150 Rs./HR
2. Bowling -- 100 Rs./HR
3. Snooker -- 250 Rs./HR
4. VR World Gaming -----> 400 Rs./HR
5. Video Games -----> 300 Rs./HR
6. Swimming Pool Games -----> 350 Rs./HR 7. Exit """)
game=int(input("Enter What Game You Want To Play : ")) hour=int(input("Enter No Of Hours You
Want To Play : ")) print("\n\n#################################################")
Class XII ARNAV JAIN 2021-22
if game==1:
print("YOU HAVE SELECTED TO PLAY : Table Tennis") gamingbill =
hour * 150
elif game==2:
print("YOU HAVE SELECTED TO PLAY : Bowling")
gamingbill = hour * 100 elif
game==3:
print("YOU HAVE SELECTED TO PLAY : Snooker")
gamingbill = hour * 250 elif
game==4:
print("YOU HAVE SELECTED TO PLAY : VR World Gaming")
gamingbill = hour * 400 elif
game==5:
print("YOU HAVE SELECTED TO PLAY : Video Games")
gamingbill = hour * 300 elif game
==6:
print("YOU HAVE SELECTED TO PLAY : Swimming Pool Games") gamingbill =
hour * 350
else:
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again !!! ") return
sql= "INSERT INTO GAMING VALUES(%s,%s,%s,%s)"
values= (cid,game,hour,gamingbill)
cursor.execute(sql,values) cursor.execute("COMMIT")
print("Your Total Gaming Bill Is : Rs. ",gamingbill)
print("FOR : ",hour," HOURS","\n *** WE HOPE YOU WILL ENJOY YOUR GAME ***") print("\n\
n#################################################")
cursor.close()
else:
print("ERROR ESTABLISHING MYSQL CONNECTION !")
def Fashion():
global cid customer=searchCustomer()
if customer:
global fashionbill if
myConnection:
cursor=myConnection.cursor()
createTable ="""CREATE TABLE IF NOT EXISTS FASHION(CID VARCHAR(20),DRESS
VARCHAR(30),AMOUNT VARCHAR(30),BILL VARCHAR(30))”””
cursor.execute(createTable) print("""
1. Shirts -----> 1500 Rs.
2. T-Shirts -----> 300 Rs.
3. Pants -----> 2000 Rs.
4. Jeans -----> 4000 Rs.
5. Tassel top -----> 500 Rs. 6. Gown -----
> 3000 Rs.
7. Western dress -----> 3000 Rs.
8. Skirts -----> 400 Rs.
9. Trousers -----> 200 Rs.
10. InnerWear -----> 30 Rs. """)
dress=int(input("Enter the your Choice wear: ")) quantity=int(input("How many you
want to buy: "))
Class XII ARNAV JAIN 2021-22
if dress==1: print("\nShirts")
fashionbill = quantity * 1500 elif dress==2:
print("\nT-Shirts") fashionbill = quantity
* 300
elif dress==3: print("\
nPants")
fashionbill = quantity * 2000
elif dress==4: print("\
nJeans")
fashionbill = quantity * 4000 elif dress==5:
print("\nTassel top")
fashionbill = quantity * 500 elif
dress==6:
print("\nGown")
fashionbill = quantity * 3000 elif dress==7:
print("\nWestern dress") fashionbill = quantity
* 3000
elif dress==8: print("\nSkirts") fashionbill =
quantity * 400
elif dress==9: print("\nTrousers") fashionbill
= quantity * 200
elif dress==10: print("\nInnerWear")
fashionbill = quantity * 30
else:
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again !!! ")
return
sql= "INSERT INTO FASHION VALUES(%s,%s,%s,%s)"
values= (cid,dress,quantity,fashionbill)
cursor.execute(sql,values) cursor.execute("COMMIT")
print("\n\n#################################################")
print("\nYOU SELECT ITEM NO : ",dress,"\nYOUR QUANTITY IS : ",quantity," ITEMS","\
nTHANK YOU FOR SHOPPING VISIT AGAIN!!!" )
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
def totalAmount(): global
cid
customer=searchCustomer() if
customer:
global grandTotal global
roomrent global restaurentbill
global fashionbill global
gamingbill
Class XII ARNAV JAIN 2021-22
if myConnection:
cursor=myConnection.cursor()
createTable ="""CREATE TABLE IF NOT EXISTS TOTAL(CID VARCHAR(20),C_NAME
VARCHAR(30),ROOMRENT INT ,RESTAURENTBILL INT ,GAMINGBILL INT,FASHIONBILL
INT,TOTALAMOUNT INT)"""
cursor.execute(createTable)
print("""
************** LOTUS VALLEY INTERNATIONAL SCHOOL NOIDA **********************
*************** HOTEL MANAGEMENT SYSTEM ************************* #*******
Designed and Maintained By: ***************************
#******* ARNAV JAIN - CLASS XII ARYABHATTA - ROLL NO – 4 - [2021-2022 ]**** """)
myConnection = MYSQLconnectionCheck() if
myConnection:
MYSQLconnection()
while(True):
print("""
1--->Enter Customer Details 2---
>Booking Record
3--->Calculate Room Rent
4--->Calculate Restaurant Bill 5---
>Calculate Gaming Bill
6--->Calculate Fashion store Bill 7--->Display
Customer Details
8--->GENERATE TOTAL BILL AMOUNT
9--->GENERATE OLD BILL
10--->EXIT
""")
choice = int(input("Enter Your Choice")) if choice == 1:
userEntry()
elif choice ==2:
bookingRecord()
elif choice ==3:
roomRent() elif
choice ==4:
Restaurent() elif
choice ==5:
Gaming()
elif choice ==6:
Fashion()
elif choice ==7:
searchCustomer()
elif choice ==8:
totalAmount() elif
choice ==9:
searchOldBill() elif
choice ==10:
break
else:
print("Sorry ,You Are Giving Me Wrong Input, Please Try Again !!! ")
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
# END OF PROJECT
Class XII ARNAV JAIN 2021-22
ANNEXURE
Functions:
1.) def MYSQLconnection():
global username – Username of the user global password –
password set by the user
global myConnection – python and mysql connection validation global cid – id given to the
user
• All variables used are self explanatory (the meaning is same as their name). For example,
noofdays meaning the no. of days the user implemented the given facility.
Class XII ARNAV JAIN 2021-22
BIBLIOGRAPHY
• Google.com
• Slideshare.com
• W3s.co.in
• python.org
• Code Academy
• tutorialsPoint.com
• PythonChallenge.com
• Google’s Python Class
• LearnPython.org
• layak.in