Professional Documents
Culture Documents
Rayhan CS Project FINAL
Rayhan CS Project FINAL
Rayhan CS Project FINAL
Done by -
Rayhan Shaikh
12-B
Adm No: 310091
Roll No: 28
Rayhan Shaikh
Roll No: 28
2
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
Signature :
Rayhan Shaikh
Roll No: 28
5
ACKNOWLEDGEMENT
Signature :
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
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
Rayhan Shaikh
Roll No: 28
11
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
Rayhan Shaikh
Roll No: 28
13
OBJECTIVE
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.
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.
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
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.
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.
Rayhan Shaikh
Roll No: 28
23
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
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.
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.
Rayhan Shaikh
Roll No: 28
28
Output:
Rayhan Shaikh
Roll No: 28
29
Rayhan Shaikh
Roll No: 28
30
Output:
Rayhan Shaikh
Roll No: 28
31
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
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:
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
Rayhan Shaikh
Roll No: 28
46
Output:
Rayhan Shaikh
Roll No: 28
47
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
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
Input:
Rayhan Shaikh
Roll No: 28
60
Output:
Rayhan Shaikh
Roll No: 28
61
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