Professional Documents
Culture Documents
2023 - 12 - 23 4 - 57 PM Office Lens
2023 - 12 - 23 4 - 57 PM Office Lens
MediaTek Open
Source Code
ans=" Y"
def guest () :
e lif
addrecords ( )
el if x==3:
search ()
el if x==4:
delete ( )
el if x==5:
guestgr ( )
el if x==6:
changerecord ( )
el if x
print INPUT")
def guestgr () :
el if x—=2:
sobgraph ( )
Ad Location Intelligence
MediaTek Open
— S SCRIBD Search
import pymysql
import matplotlib .pyplot as pit
dl=pymysql .connect (host=" local host " ,user=" root " ,pas sw
cl=dl . cursor ( )
Ist=list (x)
quer=' ' 'select count (* ) from guest where
type of ''
cl .execute (quer)
y=cl . fetchone ( )
Istl—list (y)
quer ' ' 'select count (* ) from guest where
type of
cl .execute (quer)
z=cl . fetchone ( )
1st3=1ist (a)
1stt=1st+1st1+1st2+1st3
["single" "double" , "triple" ,"quad" ]
PI t .bar (y, 1st t, width—O. 50)
plt.xlabel ("types of rooms")
PI t . ylabel ( "no . of rooms " )
PI t. show ()
def sobgraph () :
import pymysql
import matplotlib .pyplot as p It
cl=dl . cursor ( )
Ist=list (x)
quer="select count (* ) from guest where
source of booking='offline'
Download
S SCRIBD
Ad Location Intelligence
MediaTek Open
cl .execute (quer)
y=cl . fetchone ( )
import pymysql
import pandas as pd
pd. set option ('display .expand frame repr' ,False)
in " . "check
out " room no" :" room " , " source of booking " :" source of
booking" , "netpay" :"net payment " } ,axis—I)
print (df)
def addrecords () :
import pymysql
import pandas as pd
cl=dl . cursor ( )
cl .execute (quer2)
if cl .rowcount
break
y=input ("Enter the guest name :
an— " yes "
while an==" yes
v=input ("enter the type of room: ")
If v— single" •
Download
Deliver a smarter
Ad Location Intelligence x
MediaTek Open
SCRIBD Search
an="no
elif :
an="no
el if :
an="no
el if :
an=" no
ans3="nooo'
elif a=—
if :
while ans2=="
for i in range (1, 51) :
c=i
quer2=" select * from guest where
room no=%d"
cl .execute (quer2)
if cl .
ans2="no"
break
el if double" :
while ans2=="ye
for i in range (51,101) :
Download
— S SCRIBD Search
if cl .
ans2="no"
break
el if :
while ans2=="
for i in range (151,201) :
c=i
quer2=" select from guest where
room
cl .execute (quer2)
if cl
ans2="no"
break
if v — single"
el if double" :
el if v — "triple" :
el if quad" :
in "
out" 'room no" : " room " , " source of booking " : ''source of
booking" , "netpay" :"net payment" } ,axis=l)
print (dfl)
else:
print ("Thank You")
def search () :
import pymysql
import pandas as pd
cl=dl . cursor ( )
in", Cl-leck
out" 'room no" :"room " , "source of booking " source of
booking" ,"netpay" :"net payment") ,axis—I)
print (dfl)
el if cho—=2:
in "
out" room no" :"room " , "source of booking" :" source of
booking" ,"netpay" :"net payment " },axis=l)
print (dfl)
el if cho==3:
Download
S SCRIBD
out" 'room no" :"room " , "source of booking" :" source of
booking " "netpay": "net payment"), axis=l)
print (dfl)
elif
Download
Lisez sans publicité. Soescrire
import pymysql
cl=dl . cursor ( )
import pymysql
import pandas as pd
pd. set option ('display. expand frame repr' ,False)
cl=dl . cursor ( )
Download
Read without ads.
quer="update guest set cidate— where
guestid=%d" % (y,guid)
cl execute (quer)
dl . commit ( )
If y— single":
while
for i in range (1, 51) :
break
el if :
while ans2=="
for i in range (101,151) :
c=i
quer2=" select * from guest
where room no=%d"
cl .execute (quer2)
if cl .
ans2="no"
break
el if 'quad" :
while :
for i in range (151,201) :
Download
— g SCRIBD Search
quer2—” selece * from guest
where room
CI .execute (quer2)
if cl
break
guest set zoom rıo—'
where % (c, guid)
cl .execute (querl)
dl . commit ( )
if single” :
b-2000*r [0]+ [0]*9/50)
elif double” •
b-4000*r [0]+ [0]*9/50)
elif :
[0] *9/50)
elif y— ”quad” :
elif
addrecordss ( )
elif
searchrec ( )
elif
deleterec ( )
elif
staffgr ( )
elif
changerec ( )
elif
print (”XtXt1NVAILD INPUT”)
def staffgr() :
Download
Save 10% on Offical Exam Prep x
Hurry—offerends 15 Decenter SAVE NOW>
el if
salgraph ( )
def deptgraph () :
import pymysql
import matplotlib .pypLot as PI t
cl=dl . cursor ( )
1 st—list (x)
quer=" select count (* ) from staff where
dept—' cleaning' ; "
cl .execute (quer)
y=cl . fetchone ( )
Istl=list (y)
quer=" select count (* ) from staff where dept—'food
and beverages '; "
cl .execute (quer)
z=cl . fetchone ( )
Ist=list (x)
quer=" select count (* ) from staff where sal=4000; "
cl .execute (quer)
y=cl . fetchone ( )
1st2=1ist (z)
Istt 1st+IstI+Ist2
Y ["2000" "4000" " 6000"]
put. bar (y,Istt)
PI t. x label salary" )
pit .ylabel ("no .ofstaff" )
put. show ()
def addrecordss () :
import pymysql
print (
yes "
while ansl=="yes
for i in range (1,201) :
cl . execute (guer2 )
if cl . :
ansl—"no"
break
y=input ("Enter the name: ")
a—input ("Enter the department: ")
If a"" cleaning" :
j=2000
el if and beverages" :
j=4000
elif a "managment "•
j=6000
z input ("Enter the hiredate: ")
quer—"lnsert into staff
values (*d, '*s'
cl .execute (guer)
dl . commit ( )
— S SCRIBD Search
dl=pymysql .connect (host=" local host " ,user=" root " ,pas sw
cl=dl . cursor ( )
dl=pymysql .connect (host=" local host " ,user=" root " ,pas sw
d=' " database="hotel")
cl=dl . cursor ( )
Download
ox x
Save on Offical Exam Prep
Hurry—offerends 15 SAVE NOW>
— S SCRIBD Search
import pymysql
import pandas as pd
dl=pymysql .connect (user=" root " ,host=" local host " ,passw
cl=dl . cursor ( )
cl . execute (querl )
if cl .rowcount>O:
print ("DUPLICATE INPUT")
e lif cl .
ansl="no"
Download
x
Save on Offical Exam Prep
Hurry—offerends 15 SAVENOW»
— g SCRIBD Search
if Y¯—z”cleaning” :
j-2000
elif and beverages” :
j-4000
elif :
j-6000
staff set sal—' where
id-%d” % (j, sid)
cl .execute (querl)
dl . commit ( )
import pymysql
import pandas as Pd
dl—pyrnysql .connect (host—” loca I host " ,user—” root " ,pas sw
da taba se—" hotel ” )
cl—dl . ()
Download
ox x
Save on Offical Exam Prep
Hurry—offerends 15 Decente SAVE NOW>
print (
print (
print •k
print ( •k
el if x==2:
staff ( )
el if x==3:
quit ( )
elif x! =
print INPUT")
ans=input ("want to continue: ")
Output Screens:
Guest Data handling
I. Show all the records:
Download
2. Add record of guest: