Computer Project
Computer Project
Name : Date :
Poshit Nagda
content
ABOUT PYTHON
FEATURES OF PYTHON
ABOUT My SQL
FEATURE OF My SQL
REQUIREMENTS
ABOUT THE PROJECT
CODING
TABLE STRUCTURE
BIBLIOGRAPHY
About Python……
1. EASY TO USE.
2. INTEPRETED LANGUAGE
3. CROSS PLATFORM LANGUAGE
4. EXPRESSIVE LANGUAGE
5. COMPLETENESS
6. FREE & OPEN SOURCE
SHORT COMINGS OF
PYTHON
1.LESSER LIBRARIES
2.SLOW LANGUAGE
3. WEAK ON TYPE BINDING
About MYSQL……
MySQL is currently the most popular open source
database software. It is a multi-user, multi threated
database management system. MySQL is espically
popular on the web. It is one of the parts of the very
popular LAMP platform. Linux , Apache, MySQL and
PHP or WIMP platform Windows. All was founded by
Michael Wide (Monty).David Axmark and Allan
Larsson in Sweden in year 1995.
Features Of MySQL
Open source & free of cost:
Software requirements
1. Opening system: windows 10.
2. Python 3: for execution of program.
3. MySQL: for starting data in database
4. . Python-MySQL Connector: for database
connectivity.
5. Microsoft Word: for presentation of output.
About The Project…
My project on “HOTEL MANAGEMENT
SYSTEM” gives an about idea about management in
hotel. The package gives all the information
regarding the maintenance of guest’s bill during
one’s stay at the hotel and withal the allocation of
rooms for them. It contains all the basic functions
which include entering customer’s data, calculation
room rent, restaurant bill, laundry bill, etc.
Coding:
import os
import platform
import mysql.connector
import pandas as pd
import datetime
global z
mydb = mysql.connector.connect(user='root', password='poshit',
host='localhost',
database='hotel')
mycursor=mydb.cursor()
def registercust():
L =[]
name=input("enter name:")
L.append(name)
addr=input("enter address:")
L.append(addr)
indate=input("enter check in date:")
L.append(indate)
outdate=input("enter check out date:")
L.append(outdate)
cust=(L)
sql="insert into custdata(name,addr,indate,outdate)values(%s,%s,%s,
%s)"
mycursor.execute(sql,cust)
mydb.commit()
def roomtypeview():
print("Do yoy want to see room type available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from roomtype"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
def roomrent():
print ("We have the following rooms for you:-")
print ("1. type A >rs 1000 PN\-")
print ("2. type B >rs 2000 PN\-")
print ("3. type C >rs 3000 PN\-")
print ("4. type D >rs 4000 PN\-")
x=int(input("Enter Your Choice Please->"))
n=int(input("For How Many Nights Did You Stay:"))
if(x==1):
print ("you have opted room type A")
s=1000*n
elif (x==2):
print ("you have opted room type B")
s=2000*n
elif (x==3):
print ("you have opted room type C")
s=3000*n
elif (x==4):
print ("you have opted room type D")
s=4000*n
else:
print ("please choose a room")
print ("your room rent is =",s,"\n")
def restaurentmenuview():
print("Do yoy want to see mebu available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
if ch==1:
sql="select * from restaurent"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
def Menuset():
print("enter 1: To enter customer data")
print("enter 2 : To view roomtype")
print("enter 3 : for calculating room bill")
print("enter 4 : for viewing restaurent menu")
print("enter 5 : for restaurent bill")
print("enter 6 :for laundary bill")
print("enter 7 : for complete bill")
print("enter 8 : for exit:")
try:
userinput=int(input("pleaseselect an above option:"))
except valueerror:
exit("\n hi thats not a number")
registercust()
elif(userinput==2):
roomtypeview()
elif(userinput==3):
roomrent()
elif(userinput==4):
restaurentmenuview()
elif(userinput==5):
orderitem()
elif(userinput==6):
laundarybill()
elif(userinput==7):
viewbill()
elif(userinput==8):
quit()
else:
print("enter correct choice")
Menuset()
def runagain():
runagain=input("\n want to run again y/n:")
while(runagain.lower()=='y'):
if(platform.system()=="windows"):
print(os.system('cls'))
else:
print(os.system('clear'))
Menuset()
runagain=input("\n want to run again y/n:")
runagain()
Output:
Table Structure:
Bibliography