0% found this document useful (0 votes)
57 views13 pages

PSG College of Technology

This document describes a Python mini project on a hotel management system. It includes 4 sections: introduction, problem statement, categories handled, and Python script. The introduction explains that the project satisfies customer needs at a hotel using a single Python module. The problem statement indicates the project handles room facilities, restaurant, laundry, and games. The categories handled are classes and objects, and functions. The Python script contains the hotel class with methods for inputting customer data, calculating bills, and displaying the total. It also includes a main function that calls the hotel class methods recursively to handle multiple customers.

Uploaded by

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

PSG College of Technology

This document describes a Python mini project on a hotel management system. It includes 4 sections: introduction, problem statement, categories handled, and Python script. The introduction explains that the project satisfies customer needs at a hotel using a single Python module. The problem statement indicates the project handles room facilities, restaurant, laundry, and games. The categories handled are classes and objects, and functions. The Python script contains the hotel class with methods for inputting customer data, calculating bills, and displaying the total. It also includes a main function that calls the hotel class methods recursively to handle multiple customers.

Uploaded by

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

PSG COLLEGE OF TECHNOLOGY

PYTHON MINI PROJECT

TOPIC : HOTEL MANAGEMENT SYSTEM

BY
S.HARI VISHNU (17Z319)
S.KARTHIKEYAN (17Z324)
M.PRITHIV RAJ (17Z338)
R.RAHUL (17Z340)
TABLE OF CONTENT

1. INTRODUCTION

2. PROBLEM STATEMENT

3. CATEGORY HANDLED

3.1. CLASS AND ITS OBJECTS

3.2. FUNCTIONS

4. PYTHON SCRIPT

5. OUTPUT
INTRODUCTION :
The project we taken is “ HOTEL
MANAGEMENT SYSTEM “ using Python Programming
Language. This system is used to satisfy the need of incoming
customers of our hotel. Here we have a single module called
“hotel.py” to satisfy the customer needs.

PROBLEM STATEMENT :
This project contains room
facility , restaurant, laundry and enjoying with games. The
management have to get the detail from the customer who
visits the hotel and calculate the room rent for how many
days they accommodate the room, food rate for which they
ordered, gaming bill , laundry bill and finally calculate the
total rate for a particular or family of customers.
Category Handled :
 Class and its objects
 Functions

CLASS AND ITS OBJECTS :


Classes provide a means of
bundling data and functionality together. Creating a new class
creates a new type of object, allowing new instances of that
type to be made. Each class instance can have attributes
attached to it for maintaining its state. Class instances can also
have methods (defined by its class) for modifying its state.
Compared with other programming languages, Python’s class
mechanism adds classes with a minimum of new syntax and
semantics.
The syntax is :
class ClassName:
<statement-1>
.
.
.
<statement-N>

The member function and its descriptions are


tabulated as below,

CLASS NAME MEMBER FUNCTION MEMBER FUNCTION


DEFINITION

 INPUTDATA()  TO GET DETAILS


 ROOMRENT() FROM
CUSTOMERS.
 RESTAURENTBILL()  TO CALCULATE
HOTEL  LAUNDRYBILL() THE ROOM RENT.
(OBJ NAME : a)  GAMEBILL()  TO CALCULATE
 DISPLAY() FOOD RATE.
 TO CALCULATE
THE LAUNDRY
BILL.
 TO CALCULATE
GAME BILL.
 TO DISPLAY THE
TOTAL DETAILS
OF THE
CUSTOMER.

When a class defines an __init__() method, class instantiation


automatically invokes __init__() for the newly-created class
instance.
FUNCTIONS :
Recursion is a way of programming or
coding a problem, in which a function calls itself one or more
times in its body. Usually, it is returning the return value of
this function call. If a function definition fulfils the condition
of recursion, we call this function a recursive function.
The syntax is :
def function_name:
statement 1
statement 2
function_name()
Likewise , we use recursive function
called “MAIN” function which is called recursively for
storing all the visiting customers.
PYTHON SCRIPT :

********************************HOTEL.PY***********************************
class hotel:

def __init__(self,rt='',s=0,p=0,r=0,t=0,a=1800,name='',address='',cindate='',coutdate='',rno=101):

print ("\n\n*****WELCOME TO PSG HOTEL*****\n")

self.rt=rt

self.r=r

self.t=t

self.p=p

self.s=s

self.a=a

self.name=name

self.address=address

self.cindate=cindate

self.coutdate=coutdate

self.rno=rno

def inputdata(self):

self.name=input("\n Enter your name:")

self.address=input("\n Enter your address:")

self.cindate=input("\n Enter your check in date (dd-mm-yy):")

self.coutdate=input("\n Enter your checkout date (dd-mm-yy):")

print("Your room no.:",self.rno,"\n")

def roomrent(self):

print ("Room Choice:-")

print ("1.Rs 6000\n")

print ("2.Rs 5000\n")

print ("3.Rs 4000\n")

print ("4.Rs 3000\n")

x=int(input("Enter Your Choice : "))

n=int(input("How Many Nights Did You Stay:"))


if(x==1):

print ("\nYou have opted room type A")

self.s=6000*n

elif (x==2):

print ("\nYou have opted room type B")

self.s=5000*n

elif (x==3):

print ("\nYou have opted room type C")

self.s=4000*n

elif (x==4):

print ("\nYou have opted room type D")

self.s=3000*n

else:

print ("\nRequesting to choose a room")

print ("\nYour room rent is =",self.s,"\n")

def restaurentbill(self):

print("*****RESTAURANT MENU*****")

print("1.Water-Rs20","\t2.Tea-Rs10","\n3.breakfast combo-Rs90","\t4.lunch-
Rs110","\n5.dinner-Rs150","\t6.Exit")

while (1):

c=int(input("Enter your choice:"))

if (c==1):

d=int(input("Enter the quantity:"))

self.r=self.r+20*d

elif (c==2):

d=int(input("Enter the quantity:"))

self.r=self.r+10*d

elif (c==3):

d=int(input("Enter the quantity:"))

self.r=self.r+90*d
elif (c==4):

d=int(input("Enter the quantity:"))

self.r=self.r+110*d

elif (c==5):

d=int(input("Enter the quantity:"))

self.r=self.r+150*d

elif (c==6):

break;

else:

print("Invalid option")

print ("Total food Cost=Rs",self.r,"\n")

def laundrybill(self):

print ("******LAUNDRY MENU*******")

print ("\n1.Shorts-Rs3","\t2.Trousers-Rs4","\n3.Shirt-Rs5","\t4.Jeans-Rs6","\n5.Girlsuit-
Rs8","\t6.Exit")

while (1):

e=int(input("Enter your choice:"))

if (e==1):

f=int(input("Enter the quantity:"))

self.t=self.t+3*f

elif (e==2):

f=int(input("Enter the quantity:"))

self.t=self.t+4*f

elif (e==3):

f=int(input("Enter the quantity:"))

self.t=self.t+5*f

elif (e==4):

f=int(input("Enter the quantity:"))

self.t=self.t+6*f

elif (e==5):
f=int(input("Enter the quantity:"))

self.t=self.t+8*f

elif (e==6):

break;

else:

print ("Invalid option")

print ("\nTotal Laundary Cost=Rs",self.t,"\n")

def gamebill(self):

print ("******GAME MENU*******")

print ("\n1.Table tennis-Rs60","\t2.Bowling-Rs80","\n3.Snooker-Rs70","\t4.Video games-


Rs90","\n5.Pool-Rs50==6","\t6.Exit")

while (1):

g=int(input("Enter your choice:"))

if (g==1):

h=int(input("No. of hours:"))

self.p=self.p+60*h

elif (g==2):

h=int(input("No. of hours:"))

self.p=self.p+80*h

elif (g==3):

h=int(input("No. of hours:"))

self.p=self.p+70*h

elif (g==4):

h=int(input("No. of hours:"))

self.p=self.p+90*h

elif (g==5):

h=int(input("No. of hours:"))

self.p=self.p+50*h

elif (g==6):

break;
else:

print ("Invalid option")

print ("Total Game Bill=Rs",self.p,"\n")

def display(self):

print ("******HOTEL BILL******")

print ("Customer details:")

print ("Customer name:",self.name)

print ("Customer address:",self.address)

print ("Check in date:",self.cindate)

print ("Check out date",self.coutdate)

print ("Room no.",self.rno)

print ("Your Room rent is:",self.s)

print ("Your Food bill is:",self.r)

print ("Your laundary bill is:",self.t)

print ("Your Game bill is:",self.p)

self.rt=self.s+self.t+self.p+self.r

print ("Your sub total bill is:",self.rt)

print ("Additional Service Charges is",self.a)

print ("Your grandtotal bill is:",self.rt+self.a,"\n")

self.rno+=1

def main():

a=hotel()

while (1):

print("1.Enter Customer Data")

print("2.Calculate room rent")

print("3.Calculate restaurant bill")

print("4.Calculate laundry bill")

print("5.Calculate gamebill")

print("6.Show total cost")

print("7.EXIT")
b=int(input("\nEnter your choice:"))

if (b==1):

a.inputdata()

if (b==2):

a.roomrent()

if (b==3):

a.restaurentbill()

if (b==4):

a.laundrybill()

if (b==5):

a.gamebill()

if (b==6):

a.display()

if (b==7):

print("\n*******THANK YOU*******\n")

quit()

main()
THE OUTPUT :
___________________________________THANK YOU_____________________________________

You might also like