Rayhan CS Project FINAL

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 71

1

Hotel Bill Management

Done by -
Rayhan Shaikh
12-B
Adm No: 310091
Roll No: 28
Rayhan Shaikh
Roll No: 28
2

The Indian Community School, Kuwait


Department of Computer Science
Bonafide Certificate

CERTIFIED TO BE THE PROJECT WORK IN COMPUTER SCIENCE


DONE BY MR RAYHAN SHAIKH OF CLASS XII – B
IN THE INDIAN COMMUNITY SCHOOL, KUWAIT
DURING ACADEMIC YEAR 2023-24

DATED : __________ P.G.T. IN COMPUTER SCIENCE


INTERNAL EXAMINER
THE INDIAN COMMUNITY SCHOOL, KUWAIT

Submitted for all Indian Senior School Certificate Examination at the


Indian Community School, Kuwait
DATE : __________ EXTERNAL EXAMINER_________

Rayhan Shaikh
Roll No: 28
3

Rayhan Shaikh
Roll No: 28
4

DECLARATION
I hereby declare that the work presented in this Project is the original

work done by me Mr. Rayhan Shaikh of class XII – B during the

academic year 2023-24

Signature :

Name : Rayhan Shaikh

Rayhan Shaikh
Roll No: 28
5

ACKNOWLEDGEMENT

I would like to express my sincere gratitude to my computer science


teacher, Mathew Sir, and other members of the computer science
department who have played a significant role in the success of this
project. Their contributions, guidance, and support have been
invaluable. I would also like to thank our principal Mr. K Gangadhar
who gave me the golden opportunity to do this wonderful project. I am
also grateful to my dear friends for their continuous encouragement
and valuable insights throughout the process. Their knowledge and
contributions have been instrumental in overcoming challenges and
finding innovative solutions. Their dedication and attention to detail
have been crucial in ensuring the project's success

Furthermore, I would like to acknowledge the support and contribution


of my loving family. Their generous funding and resources have made
a significant impact on this project, enabling me to achieve my goals.

Lastly, I would like to express my gratitude to everyone who has


provided their time, feedback, and encouragement along the way.
Without the collective efforts and support of these individuals, this
project would not have been possible.

Signature :

Name : Rayhan Shaikh

Class : XII - B

Rayhan Shaikh
Roll No: 28
6

Rayhan Shaikh
Roll No: 28
7

Index
SNO TOPIC PAGE

1 INTRODUCTION 11

2 DOCUMENTATION 17

3 LOGIN & SOURCE CODE 31

4 MAIN MENU & SOURCE CODE 33

5 BOOKING ROOM - SOURCE CODE & OUTPUT 37

6 ACCESSING AVAILABLE ROOMS- SOURCE CODE & OUTPUT 47

7 ACCESING FOOD MENU - SOURCE CODE & OUTPUT 49

8 PAYING THE BILL - SOURCE CODE & OUTPUT 57

9 CUSTOMER RECORDS – SOURCE CODE & OUTPUT 61

10 DELETING RECORDS– SOURCE CODE & OUTPUT 63

11 MISCELLANEOUS FUNCTION–SOURCE CODE&OUTPUT 65

12 PROJECT CONCLUSION 69

13 BIBLIOGRAPHY 71

14 PROJECT USB 73

Rayhan Shaikh
Roll No: 28
8

Rayhan Shaikh
Roll No: 28
9

INTRODUCTION
Hotel Bill Management is an integral component of the hospitality
industry, ensuring the accurate, timely, and efficient processing of
guest transactions. As hotels aim to deliver exceptional guest
experiences, a robust bill management system serves as the
backbone, managing everything from room charges to dining
expenses, spa services, and other ancillary offerings. Such systems
not only reduce human errors but also streamline operations,
offer guests transparency, and accelerate the checkout process.
Given the dynamic nature of hotel services and the diverse needs
of guests, a sophisticated bill management system is
indispensable in maintaining the reputation and operational
efficacy of modern hotels.
Here are some benefits of using a computer program for bill
management:
 Real-time updates: The program can provide real-time updates on
inventory levels, allowing employees and customers to know
whether an item is in stock
 Improved accuracy: The program can improve the accuracy of
inventory records by eliminating the need for manual processes
 Decreased overhead costs: The program can decrease overhead
costs by reducing the need for staff to manage inventory.
 Reduction in human error: The program can greatly reduce
human error by removing the human element from everything
except the actual handling of the items

Rayhan Shaikh
Roll No: 28
10

 Time savings: The program can save time by streamlining various


inventory operations.

Rayhan Shaikh
Roll No: 28
11

For a hotel, utilizing a computer program to manage billing processes is


incredibly advantageous. The program is designed to meticulously track
various records related to guest stays and services, enabling seamless
management of billing information. It facilitates the addition of newly
incurred charges, ensuring that the hotel's financial records are always
up-to-date.

PROBLEM STATEMENT

For any business Inventory is one of the most important departments that
must be well managed to run daily business activity smoothly. Not using
a computer program to deal with inventory management for a music
shop can have several disadvantages
For example,
 Manual processes: Without a computer program, inventory
management would have to be done manually, which can be time-
consuming and prone to human error
 Lack of real-time updates: Without a computer program, it would
be difficult to provide real-time updates on inventory levels, which
can lead to inaccurate information being provided to customers and
employees
 Difficulty in forecasting and planning: Without a computer
program, it would be challenging to track where inventory is, how
much is on-hand, and when to reorder, which can make forecasting
and planning difficult

Rayhan Shaikh
Roll No: 28
12

 Increased overhead costs: Without a computer program,


managing inventory would require more staff, which can increase
overhead costs

Rayhan Shaikh
Roll No: 28
13

Overall, not using a computer program for inventory management can


lead to inefficiencies, inaccuracies, and increased costs for a music shop.

OBJECTIVE

The objective of project is to build an application program to:


 Provide function to manage goods in the store more efficiently.
 Provide real-time updates to records, for the purposes of
modification
 Reduce paperwork.
 Provide searching facilities based on various factors.
 Reduce time and cost to control and manage bills.
 Increased accuracy and reliability.
 Lastly, enables the user to delete a non-existing record
This application program can be used easily by non-programming
personals.

Rayhan Shaikh
Roll No: 28
14

Rayhan Shaikh
Roll No: 28
15

DOCUMENTATION
This original python program that I have developed, has multiple key elements
which contributed to the overall model of the program, this consisted of:
i. 6 Functions: A function can be defined as the organized block of reusable
code, which can be called whenever required. It is basically named unit of
group of proper statements. It organizes the code very effectively and avoids
the repetition of the code.
ii. Menu-Driven Program: A menu-driven program in Python is a program that
presents a menu of options to the user and performs different tasks based on the
user's selection. The program interacts with the user by displaying a list of options
or a menu, and the user selects an option by entering a corresponding input. Each
option in the menu corresponds to a specific task or functionality that the program
can perform. The program typically uses loops and functions to display the menu,
accept user input, and execute the corresponding functionality.

Rayhan Shaikh
Roll No: 28
16

11 Functions:

I. Home Function
The code provides a menu-driven interface for various functionalities such as
booking, room information, room service, payment, and record management. We
will dive into the code structure, explain the key concepts, and provide code
examples to illustrate its usage.
Code Structure:
The code begins with the definition of the Home() function, which serves as the
main function for the Hotel Management System. Inside the Home() function, a
menu is displayed to the user using the print() function. The user is prompted to
enter a number corresponding to their desired functionality.
Following the menu display, the code utilizes conditional statements (if, elif, else)
to determine the user's choice. Depending on the user's input, the code calls the
respective functions for booking, room information, room service, payment, record
management, or exits the program.

II. Function used in booking


Rayhan Shaikh
Roll No: 28
17

Introduction
In the provided code, there is a function called date that is used for validating the
date entered during the booking process. This function checks if the date is valid
based on certain conditions.
Key Concepts
1. The function date takes a list c as input, which represents the date entered in
the format [day, month, year].
2. The function checks if the year is between 2022 and 2025 (inclusive).
3. It then checks if the month is between 1 and 12 (inclusive).
4. Depending on the month, the function further validates the day based on
specific conditions.
Code Structure
The code follows a nested if-else structure to validate the date. It checks the year,
month, and day in a hierarchical manner.

III. Function to book rooms

Rayhan Shaikh
Roll No: 28
18

The Booking function is a Python function that allows users to book hotel rooms. It
prompts the user to enter their name, phone number, address, check-in date, and
check-out date. It then validates the input and assigns a room type and price based
on the user's choice. Finally, it generates a random room number and customer ID
and displays the booking details.
Code Structure:

The Booking function follows a structured approach to handle the booking process.
It consists of several sections, each serving a specific purpose:

1. Input Section: Prompts the user to enter their name, phone number, address,
check-in date, and check-out date. Validates the input and stores the
information in the respective lists (name, add, checkin, checkout).
2. Date Manipulation Section: Splits the check-in and check-out dates into day,
month, and year components. Converts them to integers and performs date
validation.
3. Room Type Selection Section: Displays the available room types and their
prices. Prompts the user to choose a room type and assigns the
corresponding room type and price to the respective lists (room, price).
4. Random Number Generation Section: Generates random room numbers and
customer IDs using the random.randrange() function. Checks if the
generated room number and customer ID are already allotted and
regenerates them if necessary.
5. Additional Checks Section: Checks if the phone number is already
associated with a booking. If so, checks if the payment has been made. If the
payment is pending, prompts the user to complete the payment.
6. Booking Confirmation Section: Displays the booking details (room number
and customer ID) and increments the booking counter (i).
7. Navigation Section: Prompts the user to go back to the main menu or exit
the program

IV. Function to access hotel rooms information


Rayhan Shaikh
Roll No: 28
19

In this code section, we have a function called Rooms_Info() that provides


information about the different types of rooms available in a hotel. The function
displays the amenities and features of each room type and allows the user to go
back to the main menu or exit the program.
Code Structure:
The code follows a structured format with proper indentation and the use of
function and conditional statements. This ensures readability and maintainability of
the code.

V. Function to access main menu for restaurant

Rayhan Shaikh
Roll No: 28
20

The restaurant() function is a Python code snippet that simulates a restaurant menu
and calculates the total bill for a customer. It prompts the user to enter a customer
ID and displays the menu card with various food and beverage options. The user
can select items from the menu by entering the corresponding numbers. The
function then calculates the total bill based on the selected items and displays it to
the user.
Code Structure:
The code starts with the definition of the restaurant() function. It takes no
arguments and has no return value. Inside the function, it prompts the user for a
customer ID and initializes some variables. It then checks if the entered customer
ID exists in the custid list and if the corresponding customer has not already placed
an order (p[n]==0). If the conditions are met, it displays the menu card and enters a
loop to prompt the user for item selection. The loop continues until the user enters
0 to end the selection process. Inside the loop, the function uses if-elif-else
conditions to assign prices to the selected items based on the menu card. It keeps
track of the total bill (r) by adding the prices of the selected items. After the loop
ends, the function displays the total bill and updates the restaurant charges. Finally,
it prompts the user for further action and either returns to the main menu or exits
the program.

VI. Function to pay the bill


Rayhan Shaikh
Roll No: 28
21

The payment function is a crucial part of a hotel management system. It allows


customers to make payments for their hotel bookings. This function prompts the
user to enter their phone number and checks if the payment has already been made.
If the payment is pending, the function provides various modes of payment for the
customer to choose from. After the payment is made, a bill is generated with all the
necessary details.
Code Structure:
The code structure of the payment function is as follows:
1. Prompt the user to enter their phone number.
2. Iterate over the list of phone numbers to check if the entered phone number
matches any existing customer.
3. If a match is found, check if the payment is pending.
4. If the payment is pending, display the available modes of payment and
prompt the user to choose one.
5. Calculate the total amount to be paid based on room charges and restaurant
charges.
6. Display the bill with all the necessary details.
7. Update the payment status and room/customer information in the respective
lists.
8. If the payment has already been made, display a message indicating the
same.
9. If no matching customer is found, display an error message.
10.Provide an option to go back to the main menu or exit the program.

VII. Function to display the record of customers


Rayhan Shaikh
Roll No: 28
22

In this code section, we have a function called "Record" that is responsible for
displaying the hotel records. It checks if any records exist and then prints the
details of each record, including the name, phone number, address, check-in and
check-out dates, room type, and price. If no records are found, it displays a
message indicating that no records are available. After displaying the records, the
user is given an option to go back to the main menu or exit the program.
Code Structure:

The code starts with the definition of the "Record" function. Inside the function, it
first checks if any records exist by checking if the "phno" list is empty or not. If the
list is not empty, it proceeds to print the records. If the list is empty, it displays a
message indicating that no records are found.

After printing the records, the code prompts the user to enter a choice. If the user
enters 0, it calls the "Home" function to go back to the main menu. If the user
enters any other number, it exits the program.

VIII. Function to delete the record of customers

Rayhan Shaikh
Roll No: 28
23

In this code example, we have a function called delete_record() that allows us to


delete a record from a customer database. The user is prompted to enter the phone
number of the customer whose record they want to delete. The code then searches
for the record with the provided phone number and deletes it if found. If the record
is not found, an appropriate message is displayed.
Code Structure:
The code follows a structured approach to deleting a record from the
customer database. It consists of the following sections:
1. Function Definition: The delete_record() function is defined.
2. User Input: The user is prompted to enter the phone number of the customer
they want to delete.
3. Record Search: The code searches for the index of the record with the
provided phone number.
4. Record Deletion: If the record is found, it is deleted from all the
corresponding lists.
5. Feedback: Appropriate messages are displayed to inform the user about the
success or failure of the deletion process.
6. User Interaction: The user is given the option to go back or exit the program.

IX. Function to exit the program


Rayhan Shaikh
Roll No: 28
24

In this article, we will explore the code snippet provided, which contains a function
called exit_program(). This function is written in Python and is used to exit a
program gracefully. We will discuss the purpose of this function and how it can be
implemented in your Python programs.
Code Structure:
The code follows a structured approach to deleting a record from the
customer database. It consists of the following sections:
The code snippet provided contains a function called exit_program(). Let's break
down the structure of this function:
The exit_program() function consists of two lines of code. The first line calls
another function called save_data(), and the second line calls the exit() function.
The save_data() function will perform the task of saving all the data in the binary
file, which can be later accessed by the program to view the available records

X. Function to save hotel data to binary file

Rayhan Shaikh
Roll No: 28
25

In this code example, we will explore how to save hotel data to a binary file using
Python. The code provided demonstrates a function called save_data() that takes
various hotel-related information and saves it to a binary file named
"hotel_data.bin". This binary file can later be used to retrieve the saved data.
Code Structure:
The code provided consists of a single function called save_data(). This function
takes no arguments and is responsible for saving the hotel data to a binary file.

The code begins by importing the pickle module, which is required for serializing
and deserializing Python objects.
Next, we define the save_data() function. Inside this function, we create a
dictionary called data that contains various hotel-related information. This
information can include the customer's name, phone number, address, check-in and
check-out dates, room details, price, and other relevant data.
We then open a file named "hotel_data.bin" in binary write mode using
the open() function. The 'wb' argument specifies that we want to open the file in
binary write mode.
Finally, we use the pickle.dump() function to serialize the data dictionary and write
it to the binary file. The pickle.dump() function takes two arguments: the data to be
serialized (data) and the file object to which the data should be written (file).
Once the pickle.dump() function is executed, the hotel data is successfully saved to
the binary file.

XI. Function to load hotel data from binary file


Rayhan Shaikh
Roll No: 28
26

In this code section, we have a function called load_data() that is responsible


for loading data from a binary file. The binary file contains information about
hotel bookings, such as customer names, phone numbers, addresses, check-in
and check-out dates, room types, prices, and other relevant details. The function
uses the pickle module in Python to read and extract the data from the binary
file.

Code Structure:
The load_data() function follows a specific structure to load data from the binary
file. Let's break down the code structure:
1. Opening the File: The function starts by opening the binary file named
'hotel_data.bin' using the open() function. The file is opened in binary mode
('rb') to read its contents.
2. Checking if Data Exists: The code checks if the file contains any data by
reading the first byte of the file using file.read(1). If the first byte exists, it
means there is data in the file.
3. Extracting Data: If data exists in the file, the code seeks back to the
beginning of the file using file.seek(0) and then uses
the pickle.load() function to deserialize the data from the file. The
deserialized data is stored in various global variables, such
as name, phno, add, checkin, checkout, room, price, rc, p, roomno, custid, da
y, and i. These variables hold the information about hotel bookings.
4. Handling No Data: If the file does not contain any data, the code prints a
message stating "No data found in the file."
5. Exception Handling: The code includes exception handling to handle the
case where the binary file does not exist yet. In this case,
the FileNotFoundError exception is caught, and the code simply passes
without performing any action.

Rayhan Shaikh
Roll No: 28
27

Main-Menu:

Introduction:
In this article, we will explore a code snippet that represents a Hotel Management
System for Ray Hotels Inc. The code provides a menu-driven interface for various
functionalities such as booking, room information, room service, payment, and
record management. We will dive into the code structure, explain the key concepts,
and provide code examples to illustrate its usage.

Key Concepts:
User Authentication: The program prompts the user to enter a username and
password. If the credentials match the predefined values, access is granted;
otherwise, access is denied.

1. Menu-Driven Interface: The code utilizes a menu-driven approach to


interact with the user. It presents a list of options and prompts the user to
select one by entering a corresponding number.
2. Functions: The code defines several functions to handle different
functionalities of the hotel management system. Each function is responsible
for a specific task, such as booking, retrieving room information, managing
room service, processing payments, and maintaining records.
3. Conditional Statements: The code uses conditional statements (if-elif-else)
to determine the user's choice and execute the corresponding function based
on the selected option.
4. Input Handling: The code utilizes the input() function to accept user input.
It prompts the user to enter a number corresponding to their desired option.
5. Exit Functionality: The code includes an option to exit the program. If the
user selects '0', the program terminates.

Rayhan Shaikh
Roll No: 28
28

Output:

Rayhan Shaikh
Roll No: 28
29

LOGIN & SOURCE CODE


Input:

Rayhan Shaikh
Roll No: 28
30

Output:

Rayhan Shaikh
Roll No: 28
31

MAIN MENU & SOURCE CODE

Rayhan Shaikh
Roll No: 28
32

Rayhan Shaikh
Roll No: 28
33

Rayhan Shaikh
Roll No: 28
34

Output:

Rayhan Shaikh
Roll No: 28
35

BOOKING ROOM - SOURCE CODE


& OUTPUT

Input:

Rayhan Shaikh
Roll No: 28
36

Rayhan Shaikh
Roll No: 28
37

Rayhan Shaikh
Roll No: 28
38

Rayhan Shaikh
Roll No: 28
39

Rayhan Shaikh
Roll No: 28
40

Rayhan Shaikh
Roll No: 28
41

Input:

I. Search Album by Genre

Rayhan Shaikh
Roll No: 28
42

Rayhan Shaikh
Roll No: 28
43

Output:

Rayhan Shaikh
Roll No: 28
44

Output:

Rayhan Shaikh
Roll No: 28
45

ACCESSING AVAILABLE ROOMS -


SOURCE CODE & OUTPUT
Input:

Rayhan Shaikh
Roll No: 28
46

Output:

Rayhan Shaikh
Roll No: 28
47

ACCESSING FOOD MENU - SOURCE


CODE & OUTPUT

Input:

Rayhan Shaikh
Roll No: 28
48

Output:

Rayhan Shaikh
Roll No: 28
49

Input:

Rayhan Shaikh
Roll No: 28
50

Output:

Rayhan Shaikh
Roll No: 28
51

Rayhan Shaikh
Roll No: 28
52

Rayhan Shaikh
Roll No: 28
53

Rayhan Shaikh
Roll No: 28
54

Output:

Rayhan Shaikh
Roll No: 28
55

PAYMENT OF BILL - SOURCE CODE


& OUTPUT

Input:

Rayhan Shaikh
Roll No: 28
56

Output:

Rayhan Shaikh
Roll No: 28
57

Input:

Rayhan Shaikh
Roll No: 28
58

Output:

Rayhan Shaikh
Roll No: 28
59

CUSTOMER RECORDS – SOURCE


CODE & OUTPUT

Input:

Rayhan Shaikh
Roll No: 28
60

Output:

Rayhan Shaikh
Roll No: 28
61

DELETE RECORDS – SOURCE CODE


& OUTPUT
Input:

Rayhan Shaikh
Roll No: 28
62

Output:

If date is valid

Rayhan Shaikh
Roll No: 28
63

MISCELLANEOUS FUNCTIONS–
SOURCE CODE & OUTPUT

Input:

Rayhan Shaikh
Roll No: 28
64

Output:

If date is invalid:

Rayhan Shaikh
Roll No: 28
65

Input:

Rayhan Shaikh
Roll No: 28
66

Rayhan Shaikh
Roll No: 28
67

PROJECT CONCLUSION
The Hotel Bill Management System is a comprehensive desktop-based
program designed for efficient management of customer records and billing in
the hospitality industry. Tailored for small to medium-sized hotels, this
program encompasses essential features for handling customer data,
processing transactions, updating records, searching information, generating
reports, and presenting a detailed overview of the hotel's billing and occupancy
status. In summary, the implemented Python program for hotel bill
management, utilizing a binary file for data storage, offers a streamlined and
effective solution for hotel owners and managers to maintain organized and
accurate records of customer transactions. Its intuitive interface reduces the
likelihood of errors, contributing to a high level of customer satisfaction. This
project underscores the importance of leveraging technology in the context of
hotel operations, emphasizing its pivotal role in enhancing efficiency and
providing a seamless experience for both hotel staff and guests.

Rayhan Shaikh
Roll No: 28
68

Rayhan Shaikh
Roll No: 28
69

BIBLIOGRAPHY
 ARIHANT ALL IN ONE COMPUTER SCIENCE GUIDE
 Class 12 CBSE TEXTBOOK: COMPUTER SCIENCE
WITH PYTHON – PREETI ARORA
 Class 12 CBSE TEXTBOOK: COMPUTER SCIENCE
WITH PYTHON – SUMITA ARORA
 https://techtipnow.in/project-synopsis-inventory-management/

Rayhan Shaikh
Roll No: 28
70

Rayhan Shaikh
Roll No: 28
71

PROGRAM - USB

Rayhan Shaikh
Roll No: 28

You might also like