0% found this document useful (0 votes)
41 views43 pages

Dsa Postlab

Uploaded by

Vaikul Gandi
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)
41 views43 pages

Dsa Postlab

Uploaded by

Vaikul Gandi
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/ 43

PROJECT REPORT

On
“ HOTEL MANAGEMENT ”
[DSA Post-Lab]

Submitted By
Sahil S.
Chaple
(CS23010)

Guided By:-

Mr. Ratnesh Choudhary

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERIN

S. B. JAIN INSTITUTE OF TECHNOLOGY


MANAGEMENT AND RESEARCH,
NAGPUR.
(An Autonomous Institute, Affiliated to RTMNU, Nagpur)

2024-2025
1
© S.B.J.I.T.M.R Nagpur 2024

2
S.B. JAIN INSTITUTE OF TECHNOLOGY MANAGEMENT AND
RESEARCH, NAGPUR
(An Autonomous Institute, Affiliated to RTMNU, Nagpur)

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

SESSION 2024-2025

CERTIFICATE

This is to certify that the Mini Project titled “Hotel Management” is a bonafide work of Sahil S.
Chaple carried out for the partial fulfillment of course work of “Data Structure & Algorithm Lab”, 3 rd

Semester, Bachelor of Technology in Computer Science & Engineering, S. B. Jain Institute of


Technology, Management & Research, Nagpur.

Mr. Ratnesh K. Choudhary Dr. Mrudula Nimbarte


Assistant Professor Head of Department
(Project Guide)

3
INDEX

CERTIFICATE i

INDEX ii

LIST OF FIGURES iii

CHAPTER 1 INTRODUCTION 1

CHAPTER 2 METHODOLOGY 2-3

CHAPTER 3 TOOLS/PLATFORMS 4

CHAPTER 4 DESIGN & IMPLEMENTATION 5-8

4.1 ALGORITHM

4.2 FLOWCHART

4.3 SOURCE CODE

CHAPTER 5 RESULT & DISCUSSION 9-


11
5.1 OUTPUT

5.2 DISCUSSION

5.3 APPLICATION

CHAPTER 6 CONCLUSION 12

4
LIST OF FIGURES

FIG. NO. TITLE OF FIGURE PAGE NO.

4.2.1 Flowchart of “Hotel Management”


12 - 14

5.1.1. Taking user details


34

5.1.2. Display Hotel Details


35

5.1.3.1 Room Booking


35

5.1.3.2. Room Booking


36

5.1.4.1 Display food items


36

5.1.4.2. Display food items


37

5.1.5. Order Food


37

5.1.6. Bill For food


38

5.1.7. Bill For Room


39

5.1.8. Total Bill


40

5.1.9. Feedback And checkout 40

5
CHAPTER 1

INTRODUCTION:

The provided code is part of a C program that simulates a restaurant and lodge system, including
functionalities for booking rooms, ordering food, and managing customer details. Here’s an
introduction to the code:

This C program represents a basic management system for a restaurant and lodge. The primary
functionalities include:

1. Customer Details Management: Collects and validates customer information such as name,
email, and mobile number.

2. Menu Initialization and Display: Initializes a food menu with various categories and
items, and displays the menu to the customer.

3. Room Booking: Allows customers to book rooms and manage room-related details.

4. Food Ordering: Enables customers to order food items from the menu and calculates the
total food bill.

5. Bill Calculation and Display: Computes and displays the total bill, including room and
food charges.

6. Feedback and Complaints: Collects customer feedback and suggestions.

7. Navigation and User Interaction: Provides a menu-driven interface for the user to interact
with various features of the system.

The program makes use of structures to manage different aspects like food items, orders, and
room bookings.

It also includes validation functions to ensure correct input formats for email and mobile numbers.

6
CHAPTER 2

METHODOLOGY

Major Library and Functions:

Major Libraries :

1. <stdio.h>: Standard Input/Output library. It is used for input and output functions, such as
printf and scanf, which handle user interaction.
2. <stdlib.h>: Standard library for general utilities. Functions from this library are often used
for memory allocation, process control, and conversions. In this code, it's included but not
actively used.
3. <string.h>: String handling functions. Functions like strcpy and strchr are used for
manipulating and examining strings.
4. <ctype.h>: Character handling functions. Used here to check if characters are digits.

Key Functions:

1. int is_valid_email(const char email)


- Purpose: Validates the format of an email address.
- Method: Checks for the presence of an '@' character and a '.' character after '@'.

2. int is_valid_mobile(const char mobile)


- Purpose: Validates a mobile number.
- Method: Ensures the mobile number is exactly 10 digits long and consists only of digits.

3. void initialize_menu(void)
- Purpose: Initializes the food menu with predefined items and categories.

7
- Method: Uses strcpy to set names and assign prices and categories to food items in a
global menu array.

4. void print_menu(void)
- Purpose: Displays the menu to the user.
- Method: Iterates through categories and food items, printing each item’s details in a
formatted manner.

5. void begin(void)
- Purpose: Displays the main menu and handles user choices.
- Method: Uses a switch statement to call different functions based on user input (e.g.,
booking a room, ordering food, etc.).

6. void food_items(void)
- Purpose: Manages the process of ordering food items.
- Method: Displays the menu, takes user input for item choices and quantities, and
updates the ordered_items array and person.food_bill.

7. void show_details(void)
- Purpose: Shows the details of the guest and their bills.
- Method: Prints out the guest’s name, email ID, mobile number, and various bills.

8. void complaints_suggestions(void)
- Purpose: Collects feedback from the user.
- Method: Reads a line of feedback input from the user and stores it in a feedback array.

9. void book_room(void)
- Purpose: Manages room booking.
- Method: Displays room booking options, takes user input for room type and quantity, and
updates the booking information and person.room_bill.

8
CHAPTER 3

TOOLS/PLATFORMS

3.1 SOFTWARE REQUIREMENT:

1. Integrated Development Environment (IDE):

Dev-C++: A lightweight IDE for C/C++ development. It includes a compiler and a debugger,
making it suitable for small to medium-sized projects.

GDB : Another popular C/C++ IDE that offers more features and is highly configurable.

Visual Studio Code: A versatile code editor with support for C/C++ through extensions.

2. Compiler:

GCC (GNU Compiler Collection): A widely-used compiler for C/C++. It can be used through
command-line interfaces or integrated into an IDE like Dev-C++ or Code::Blocks.

MinGW (Minimalist GNU for Windows): A distribution of GCC for Windows. It includes a set
of open-source programming tools.

3. Version Control System:

Git: Useful for tracking changes in your code and collaborating with others. Platforms like
GitHub or GitLab can be used to host repositories.

4. Libraries and Dependencies:

Standard C Library: This project mainly relies on the standard C library, which is included with the
compiler.

9
Additional libraries may be needed if you plan to expand the project with features like a graphical
user interface (GUI) or database connectivity.

Operating System

Windows 10/11: Suitable for running the development environment and tools mentioned.

-Linux: Offers a great environment for C/C++ development with built-in support for GCC.

- macOS: Compatible with most C/C++ development tools.

Additional Tools (Optional)

1. Database Management System (DBMS):

- If you plan to extend the project to include persistent storage of data, consider using a
lightweight database like SQLite.

2. Debugging Tools:

-GDB (GNU Debugger): Comes with GCC and helps debug C/C++ applications.

- IDEs like Dev-C++ and Code::Blocks have built-in debugging capabilities.

3. Build Automation Tools:

- Make: Automates the build process, useful for managing project dependencies and compiling
code.

4. Text Editors:

Notepad++ or Sublime Text: Lightweight text editors that can be used for editing code and
configuration file

10
CHAPTER 4

DESIGN & IMPLEMENTATION

4.1 ALGORITHM

Initialization

1. Initialize Menu
- Call initialize_menu() to set up the food menu with predefined items, categories, and prices.

Main Program Flow


2. Display Main Menu
- Call begin() to show the main menu options to the user.

User Interaction
3. User Input
- Collect Personal Details: Prompt the user for their name, email, and mobile number.
- Validate email using is_valid_email().
- Validate mobile number using is_valid_mobile().
- Choose Options: Display main menu options (e.g., book a room, order food, provide
feedback).

Room Booking
4. Book Room
- If the user selects to book a room:
- Call book_room() to display room options and take input for room type and quantity.
- Update the booking information and calculate the room bill.

11
Food Ordering
5. Order Food
- If the user selects to order food:
- Call food_items() to display the food menu.
- Take input for food items and quantities.
- Update the order information and calculate the food bill.

Viewing Details and Feedback


6. Show Details
- If the user selects to view their details:
- Call show_details() to display personal details and bills (room and food).

7. Provide Feedback
- If the user selects to provide feedback:
- Call complaints_suggestions() to collect feedback.

Bill Calculation
8. Calculate Total Bill
- Call bill() to compute the total bill by summing up room and food bills.

End Program
9. Exit
- End the program after displaying the details and calculating the bill.

12
4.2 FLOWCHART:

START

Initialize Person
Details

Display Welcome
Message

Get
Person`s
Name

Validate
Email

Validate
Mobile
Number

Call begin
Function

Start begin Function

Display Options

Get User
Choice

Handle User
Choice

Show Details Complaints Suggestions Book Room Food Items Bill Function
Function Function Function Function

13
Show Details Function ComplaintsSuggestionsFunction

START START

Print Person Details


Get Feedback
Display the person`s name, email, mobile number, room bill,
Prompt the user to enter
food bill, and total bill.
their

Exit Exit

Food Items Function

START

Print Menu

Order Items

Exit

14
Bill Function

Start

Get Bill Choice

Display Food Bill Display Room Bill

End

Book Room Function

Start

Get Room
Quantity

No Yes
Check Room
Availability

Book Rooms

End

Fig.4.2.1 Flowchart of “Hotel Management”


15
4.3 SOURCE CODE:

include <stdio.h>
include <stdlib.h>
include <string.h>
include <ctype.h>

define MAX_FOOD_ITEMS 200


define MAX_ORDER_ITEMS 200
define MAX_ROOMS 50
define MAX_CATEGORIES 20

void begin();
void show_details();
void complaints_suggestions();
void book_room();
void food_items(void);
void initialize_menu(void);
void print_menu(void);
void bill(void);
int is_valid_email(const char email);
int is_valid_mobile(const char mobile);
typedef struct
{
char name[50];
int price;
int category;
} FoodItem;

FoodItem menu[MAX_FOOD_ITEMS];
int total_food_items = 0;

typedef struct
{
char name[50];
int quantity;
int price;
} OrderedFoodItem;

OrderedFoodItem ordered_items[MAX_ORDER_ITEMS];
int total_order_items = 0;
typedef struct
{
int roomno;
char roomtype;
16
int price;
} RoomBooking;

RoomBooking bookings[MAX_ROOMS];
int total_bookings = 0;

typedef struct
{
char name[20];
char email_id[60];
char mobile_no[11];
int room_bill;
int food_bill;
int program_bill;
} Person;

Person person;

int main()
{
initialize_menu();
person.room_bill =
0;
person.food_bill = 0;
person.program_bill = 0;
printf(".............WELCOME TO ROYAL ARENA RESTAURANT AND
LODGE..............\n\n");
printf("Please enter your details before moving to the main page!\n");

printf("Please enter your name: ");


scanf(" %[^\n]", person.name);

do {
printf("Enter your email_id: ");
scanf(" %[^\n]", person.email_id);
if (!is_valid_email(person.email_id)) {
printf("!!!!!!!!!!!!!!!!!!!````Invalid email format`````!!!!!!!!!!!!!!!!!!!\nPlease enter a valid
email address.\n");
}
} while (!is_valid_email(person.email_id));

do {
printf("Enter your mobile number:
"); scanf(" %[^\n]",
person.mobile_no);
if (!is_valid_mobile(person.mobile_no)) {
17
printf("!!!!!!!!!!!!!!!!!!!````Invalid mobile number`````!!!!!!!!!!!!!!!!!!!\nPlease enter a 10-
digit mobile number.\n");

18
}
} while (!is_valid_mobile(person.mobile_no));

begin();
return 0;
}

int is_valid_email(const char email)


{
const char at = strchr(email, '@');
if (at == NULL) {
return 0;
}
const char dot = strchr(at,
'.'); if (dot == NULL) {
return 0;
}
return 1;
}

int is_valid_mobile(const char mobile)


{
if (strlen(mobile) != 10)
{ return 0;
}
for (int i = 0; i < 10; i++) {
if (!isdigit(mobile[i])) {
return 0;
}
}
return 1;
}

void initialize_menu(void)
{
strcpy(menu[0].name, "French Fries");
menu[0].price = 106;
menu[0].category = 1;

strcpy(menu[1].name, "Chilli Cheese Toast");


menu[1].price = 80;
menu[1].category = 1;

strcpy(menu[2].name, "Chilli Cheese Gralic Toast");


menu[2].price = 115;
menu[2].category = 1;
19
strcpy(menu[3].name, "Garlic Bread");
menu[3].price = 90;
menu[3].category = 1;

strcpy(menu[4].name, "Garlic Bread with Cheese");


menu[4].price = 130;
menu[4].category = 1;

strcpy(menu[5].name, "Plain Sandwich");


menu[5].price = 175;
menu[5].category = 2;

strcpy(menu[6].name, "Grilled Sandwich");


menu[6].price = 175;
menu[6].category = 2;

strcpy(menu[7].name, "Club Sandwich");


menu[7].price = 175;
menu[7].category = 2;

strcpy(menu[8].name, "Russian Salad / Maccroni");


menu[8].price = 119;
menu[8].category = 3;

strcpy(menu[9].name, "Veg. Burger");


menu[9].price = 75;
menu[9].category = 4;

strcpy(menu[10].name, "Maccroni Hotpot");


menu[10].price = 205;
menu[10].category = 5;

strcpy(menu[11].name, "Veg. Augratin");


menu[11].price = 205;
menu[11].category = 5;
strcpy(menu[12].name, "Pasta Spicy Tomato ");
menu[12].price = 190;
menu[12].category = 6;

strcpy(menu[13].name, "Pasta in Twin Sauce");


menu[13].price = 190;
menu[13].category = 6;

strcpy(menu[14].name, "Plain Cheese Pizza");


20
menu[14].price = 190;
menu[14].category = 7;

strcpy(menu[15].name, "Capsicum, Onion Pizza");


menu[15].price = 210;
menu[15].category = 7;

strcpy(menu[16].name, "Tomato, Onion


Pizza"); menu[16].price = 210;
menu[16].category = 7;

strcpy(menu[17].name, "Capsicum, Onion, Mushroom Pizza");


menu[17].price = 250;
menu[17].category = 7;

strcpy(menu[18].name, "Jain Spl. Pizza");


menu[18].price = 250;
menu[18].category = 7;

strcpy(menu[19].name, "Tandoori Pizza");


menu[19].price = 250;
menu[19].category = 7;

strcpy(menu[20].name, "Super Veggie Pizza ");


menu[20].price = 265;
menu[20].category = 7;

strcpy(menu[21].name, "Cheese");
menu[21].price = 55;
menu[21].category = 8;

strcpy(menu[22].name, "Lasagna Roll");


menu[22].price = 133;
menu[22].category = 9;

strcpy(menu[23].name, "Paneer Salsa Wrap");


menu[23].price = 133;
menu[23].category = 9;

strcpy(menu[24].name, "Lebanese Fala Fel");


menu[24].price = 133;
menu[24].category = 9;

strcpy(menu[25].name, "Veg Chopsuey");


menu[25].price = 195;

21
menu[25].category = 10;

strcpy(menu[26].name, "Chilly Paneer Gravy");


menu[26].price = 205;
menu[26].category = 10;

strcpy(menu[27].name, "Manchurian Gravy");


menu[27].price = 175;
menu[27].category = 10;

strcpy(menu[28].name, "Sweet & Sour Veg.");


menu[28].price = 175;
menu[28].category = 10;

strcpy(menu[29].name, "Mixed Veg. in Hot Garlic Sauce");


menu[29].price = 185;
menu[29].category = 10;

strcpy(menu[30].name, "Shredded Potatoes");


menu[30].price = 153;
menu[30].category = 10;

strcpy(menu[31].name, "Veg Hakka Noodles");


menu[31].price = 145;
menu[31].category = 11;

strcpy(menu[32].name, "Chilli Garlic Noodles");


menu[32].price = 145;
menu[32].category = 11;

strcpy(menu[33].name, "Pan Fried Noodles");


menu[33].price = 225;
menu[33].category = 11;

strcpy(menu[34].name, "Gravy Noodles");


menu[34].price = 225;
menu[34].category = 11;

strcpy(menu[35].name, "Veg. Fried Rice");


menu[35].price = 165;
menu[35].category = 12;

strcpy(menu[36].name, "Chilly Garlic Rice");


menu[36].price = 165;
menu[36].category = 12;

22
strcpy(menu[37].name, "Dahi Bhalla / Dahi Papri");
menu[37].price = 90;
menu[37].category = 13;

strcpy(menu[38].name, "Dahi Bhalla Papri");


menu[38].price = 90;
menu[38].category = 13;

strcpy(menu[39].name, "Gol Gappa (6 pcs.)");


menu[39].price = 68;
menu[39].category = 13;

strcpy(menu[40].name, "Gol Gappa ");


menu[40].price = 25;
menu[40].category = 13;

strcpy(menu[41].name, "Tea");
menu[41].price = 40;
menu[41].category = 14;

strcpy(menu[42].name, "Coffee Mocachino");


menu[42].price = 51;
menu[42].category = 14;

strcpy(menu[43].name, "Coffee Americano (Black)");


menu[43].price = 55;
menu[43].category = 14;

strcpy(menu[44].name, "Coffee Espresso");


menu[44].price = 60;
menu[44].category = 14;

strcpy(menu[45].name, "Ice Tea (Lemon)");


menu[45].price = 51;
menu[45].category = 14;

strcpy(menu[46].name, "Coffee Cappuccino");


menu[46].price = 51;
menu[46].category = 14;

strcpy(menu[47].name, "Espresso (Black)");


menu[47].price = 55;
menu[47].category = 14;

strcpy(menu[48].name, "Cold-Coffee (Frappe)");


menu[48].price = 70;
23
menu[48].category = 14;
strcpy(menu[49].name, "Fruit Punch");
menu[49].price = 150;
menu[49].category = 15;

strcpy(menu[50].name, "Red Sea");


menu[50].price = 150;
menu[50].category = 15;

strcpy(menu[51].name, "Virgin Colada");


menu[51].price = 150;
menu[51].category = 15;

strcpy(menu[52].name, "Love Valley");


menu[52].price = 150;
menu[52].category = 15;

strcpy(menu[53].name, "Pomi Twist");


menu[53].price = 150;
menu[53].category = 15;

strcpy(menu[54].name, "Ginger Fizz");


menu[54].price = 150;
menu[54].category = 15;

strcpy(menu[55].name, "Italian Smooch");


menu[55].price = 150;
menu[55].category = 15;

strcpy(menu[56].name, "Devils Kiss");


menu[56].price = 150;
menu[56].category = 15;

strcpy(menu[57].name, "Blue Lagoon");


menu[57].price = 150;
menu[57].category = 15;

strcpy(menu[58].name, "Fresh Mint


Mojito"); menu[58].price = 150;
menu[58].category = 15;

strcpy(menu[59].name, "Kiwi Smoothie");


menu[59].price = 150;
menu[59].category = 15;

strcpy(menu[60].name, "Virgin Guava");


24
menu[60].price = 150;
menu[60].category = 15;

strcpy(menu[61].name, "Litchi Smoothie");


menu[61].price = 150;
menu[61].category = 15;

strcpy(menu[62].name, "Peach Apricot");


menu[62].price = 150;
menu[62].category = 15;

strcpy(menu[63].name, "Blueberry Smoothie");


menu[63].price = 150;
menu[63].category = 15;

strcpy(menu[64].name, "Green Hayland");


menu[64].price = 150;
menu[64].category = 15;

strcpy(menu[65].name, "White Rosy");


menu[65].price = 150;
menu[65].category = 15;

strcpy(menu[66].name, "Watermelon Mojito");


menu[66].price = 150;
menu[66].category = 15;

strcpy(menu[67].name, "Steam Rice");


menu[67].price = 161;
menu[67].category = 16;

strcpy(menu[68].name, "Soya Dum


Biryani"); menu[68].price = 220;
menu[68].category = 16;

strcpy(menu[69].name, "Veg. Pulao");


menu[69].price = 161;
menu[69].category = 16;

strcpy(menu[70].name, "Mix Veg. Pulao");


menu[70].price = 161;
menu[70].category = 16;

strcpy(menu[71].name, "Jeera Pulao");


menu[71].price = 161;
25
menu[71].category = 16;

strcpy(menu[72].name, "Matka Biryani With Raita");


menu[72].price = 220;
menu[72].category = 16;

strcpy(menu[73].name, "Hyderabadi Biryani");


menu[73].price = 220;
menu[73].category = 16;
strcpy(menu[74].name, "Plain Raita");
menu[74].price = 102;
menu[74].category = 17;

strcpy(menu[75].name, "Boondi Raita");


menu[75].price = 102;
menu[75].category = 17;

strcpy(menu[76].name, "Mix. Veg. Raita");


menu[76].price = 102;
menu[76].category = 17;

strcpy(menu[77].name, "Jeera Raita");


menu[77].price = 102;
menu[77].category = 17;

strcpy(menu[78].name, "Pineapple Raita");


menu[78].price = 102;
menu[78].category = 17;
strcpy(menu[79].name, "Dal Makhani");
menu[79].price = 192;
menu[79].category = 18;

strcpy(menu[80].name, "Yellow Dal");


menu[80].price = 141;
menu[80].category = 18;

strcpy(menu[81].name, "Rajma");
menu[81].price = 141;
menu[81].category = 18;

strcpy(menu[82].name, "Chole");
menu[82].price = 141;
menu[82].category = 18;
strcpy(menu[83].name, "Shahi Paneer");
menu[83].price = 210;
menu[83].category = 19;
26
strcpy(menu[84].name, "Kadhai Paneer");
menu[84].price = 210;
menu[84].category = 19;

strcpy(menu[85].name, "Paneer Butter Masala");


menu[85].price = 210;
menu[85].category = 19;

strcpy(menu[86].name, "Mushroom Masala");


menu[86].price = 215;
menu[86].category = 19;

strcpy(menu[87].name, "Malai Kofta");


menu[87].price = 210;
menu[87].category = 19;
strcpy(menu[88].name, "Gulab Jamun");
menu[88].price = 60;
menu[88].category = 20;

strcpy(menu[89].name, "Halwa (Seasonal)");


menu[89].price = 60;
menu[89].category = 20;

strcpy(menu[90].name, "Vanilla/Strawberry");
menu[90].price = 51;
menu[90].category = 20;

strcpy(menu[91].name, "Tutti Frutti");


menu[91].price = 60;
menu[91].category = 20;

strcpy(menu[92].name, "Pineapple");
menu[92].price = 60;
menu[92].category = 20;

strcpy(menu[93].name, "Chocolate");
menu[93].price = 60;
menu[93].category = 20;

strcpy(menu[94].name, "Butter Scotch");


menu[94].price = 60;
menu[94].category = 20;

strcpy(menu[95].name, "Kaju Kishmish");


menu[95].price = 60;
27
menu[95].category = 20;

strcpy(menu[96].name, "Vanilla Chocochips");


menu[96].price = 60;
menu[96].category = 20;

strcpy(menu[97].name, "Mango");
menu[97].price = 60;
menu[97].category = 20;

strcpy(menu[98].name, "Anjeer Honey");


menu[98].price = 60;
menu[98].category = 20;

strcpy(menu[99].name, "Almond Fudge");


menu[99].price = 60;
menu[99].category = 20;

strcpy(menu[100].name, "Kesar Pista");


menu[100].price = 60;
menu[100].category = 20;

total_food_items = 100;
}

void print_menu(void)
{
const char categories[MAX_CATEGORIES] =
{ "All Time Favourite",
" Sandvich",
"Salads",
"Burgers",
"Bakes & Meals (Served with 3Pcs. of Garlic Bread)",
"Choice of Pasta's (Served with 3Pcs. of Garlic Bread)",
"Pizza's",
"Extra Toppings",
"Hearth Stone Special",
"Main Course",
"Noodles",
"Rice",
"Chats",
"Tea & Coffee ",
"Smoothies & Mocktails",
"Rice / Pulao / Biryanis / Raitas",
"Dals",
"Subziyan",
28
"Dessert",
"Ice Cream"
};

for (int cat = 1; cat <= MAX_CATEGORIES; cat++)


{
printf("\n%s\n", categories[cat - 1]);
printf(" \n");
printf("| No | Item Name | Price |\n");
printf(" \n");

for (int i = 0; i < total_food_items; i++)


{
if (menu[i].category == cat)
{
printf("| %2d | %-30s | Rs %5d |\n", i + 1, menu[i].name, menu[i].price);
}
}

printf(" \n");
}
}

void begin(void)
{
int decide;
printf("\n HOW CAN WE HELP YOU?\n\n");
printf("\n1. Hotel Details\n2. Book a room\n3. Food items\n4. Separate Bill (Food+Room)\n5.
Total Bill\n6. Feedback\n7. Check out\
n"); scanf("%d", &decide);
while (getchar() != '\n')
;

switch (decide)
{
case 1:
printf("\nAbout Us\n\nWelcome to Royal Arena Restaurant and Lodge, where luxury meets
comfort…… severalspecial.\n\n");
printf("For more information, visit our website.\n");
begin();
break;
case 2:
book_room();
break;
case 3:
food_items();
29
break;
case 4:
bill();
break;
case 5:
show_details();
break;
case 6:
complaints_suggestions();
printf("Thank you for your valuable Feedback!\n");
begin();
break;
case 7:
printf("Visit again!\n");
printf("Thank you for trusting our service.\n");
return;

default:
printf("Invalid choice. Please enter a valid number.\n");
begin();
break;
}
}

void food_items(void)
{
int choice, quantity;

printf("\n FOOD ITEMS \n");


print_menu();

while (1)
{
printf("\nEnter the item number to order (0 to finish): ");
scanf("%d", &choice);
while (getchar() != '\n')
;

if (choice == 0)
break;

if (choice < 1 || choice > total_food_items)


{
printf("Invalid choice! Please try again.\n");
continue;
}
30
printf("Enter the quantity:
"); scanf("%d", &quantity);
while (getchar() != '\n')
;

if (quantity <= 0)
{
printf("Invalid quantity! Please try again.\n");
continue;
}

strcpy(ordered_items[total_order_items].name, menu[choice - 1].name);


ordered_items[total_order_items].quantity = quantity;
ordered_items[total_order_items].price = menu[choice - 1].price quantity;
person.food_bill += ordered_items[total_order_items].price;
total_order_items++;
}

begin();
}

void show_details(void)
{
printf("\n DETAILS \n");
printf(" \n");
printf("| Name: | %s\n", person.name);
printf(" \n");
printf("| Email ID: | %s\n", person.email_id);
printf(" \n");
printf("| Mobile Number: | %s\n", person.mobile_no);
printf(" \n");
printf("| Room Bill: | Rs %d\n", person.room_bill);
printf(" \n");
printf("| Food Bill: | Rs %d\n", person.food_bill);
printf(" \n");
printf("| Total Bill: | Rs %d\n", person.room_bill + person.food_bill +
person.program_bill);
printf(" \n");
begin();
}

void complaints_suggestions()
{
char feedback[500];
printf("Please enter your Feedback:\n");
31
scanf(" %[^\n]", feedback);
}

void book_room()
{
int type_of_rooms, quantity;
char c;

printf("\n ROOM BOOKING \n");


printf("\nHow many rooms do you want to book?: ");
scanf("%d", &quantity);
while (getchar() != '\n');

if (quantity > MAX_ROOMS - total_bookings)


{
printf("Sorry, we only have space for %d rooms.\n", MAX_ROOMS - total_bookings);
begin();
}

for (int i = 0; i < quantity; i++)


{
printf("\nRoom %d:\n", i + 1);
printf("What type of room do you want to book?\n");
printf("\n1. Basic Room Rs 1000\n2. Medium room Rs 2000\n3. DELUXE ROOM Rs
3000\n4. Cancel Booking\n");
scanf("%d", &type_of_rooms);
while (getchar() != '\n');

if (type_of_rooms == 1)
{
printf("\nDo you accept this room? (y/n)\n");
scanf("%c", &c);
while (getchar() != '\n');
if (c == 'y')
{
printf("\nYou chose the basic room. Enjoy your stay\n");
bookings[total_bookings].roomno = 121 + total_bookings;
bookings[total_bookings].roomtype = "basic";
bookings[total_bookings].price = 1000;
person.room_bill += 1000;
total_bookings++;
}
else
{
printf("\nBooking Cancelled.\n");
i--;
32
}
}
else if (type_of_rooms == 2)
{
printf("\nDo you accept this room? (y/n)\n");
scanf("%c", &c);
while (getchar() != '\n');
if (c == 'y')
{
printf("\nYou chose the medium room. Enjoy your stay\n");
bookings[total_bookings].roomno = 121 + total_bookings;
bookings[total_bookings].roomtype = "medium";
bookings[total_bookings].price = 2000;
person.room_bill += 2000;
total_bookings++;
}
else
{
printf("\nBooking Cancelled.\n");
i--;
}
}
else if (type_of_rooms == 3)
{
printf("\nDo you accept this room? (y/n)\n");
scanf("%c", &c);
while (getchar() != '\n');
if (c == 'y')
{
printf("\nYou chose the deluxe room. Enjoy your stay\n");
bookings[total_bookings].roomno = 121 + total_bookings;
bookings[total_bookings].roomtype = "deluxe";
bookings[total_bookings].price = 3000;
person.room_bill += 3000;
total_bookings++;
}
else
{
printf("\nBooking Cancelled.\n");
i--;
}
}
else if (type_of_rooms == 4)
{
printf("\nBooking Cancelled.\n");
i--;
33
}
else
{
printf("\nInvalid option. Please try again.\
n"); i--;
}
}

begin();
}

void bill(void)
{
int choice;
printf("\n BILL VIEW \n");
printf("\n1. Detailed Food Bill\n2. Room Bill\n");
scanf("%d", &choice);
while (getchar() != '\n');

if (choice == 1)
{
printf("\n FOOD BILL \n");
printf(" \n");
printf("| No | Item Name | Quantity | Price |\
n"); printf(" \n");

else if (choice == 2)
{
printf("\n ROOM BILL \n");
printf(" \n");
printf("| Room No | Room Type | Price |\n");
printf(" \n");

for (int i = 0; i < total_bookings; i++)


{
printf("| %7d | %-20s | Rs %5d |\n", bookings[i].roomno, bookings[i].roomtype, bookings[i].price);
}

printf(" \n");
printf("| Total Room Bill: | Rs %5d |\n",
person.room_bill); printf(" \n");
}

begin();
}

34
CHAPTER 5
RESULT & DISCUSSION

5.1 OUTPUT

Fig.5.1.1. Taking user details

The above screenshot is about the details taken from the user. Details like name , email, phone number.

35
Fig.5.1.2. Display Hotel Details

The above screenshot is about displaying the hotel details like its information , its branches , facilities
guest experience etc.

Fig.5.1.3.1 Room Booking

The above screenshot is about room booking it shows how many rooms available and how many types
of room are available and here you can also book the room.
36
Fig.5.1.3.2. Room Booking
The above screenshot is about room booking it shows how many rooms available and how many
types of room are available and here you can also book the room.

Fig.5.1.4.1 Display food items

The above screenshot is about the lists of food items in the hotel menu . That you can order its price also
mention there and divided in different section also.
37
Fig.5.1.4.2. Display food items

The above screenshot is about the lists of food items in the hotel menu . That you can order its price
also mention there and divided in different section also .

Fig.5.1.5. Order Food

The above screenshot is about the ordering of food . From the given menu you can order it . It asks
about food number according to menu and the quantity.

38
Fig.5.1.6. Bill For food

The above screenshot is about Bill for food that you order . It gives you the detailed bill like which
food you order , how many quantity and its price . At last total food bill .

Fig.5.1.7. Bill For Room

The above screenshot is about Bill for Room that you booked . It gives you the detailed bill like which
room you booked , how many quantity and its price . At last total Room bill.

39
Fig.5.1.8. Total Bill

The above screenshot is about Total Bill for food and Room that you order and booked . It gives you
the total food + room bill .

Fig.5.1.9. Feedback And checkout

The above screenshot is about the feedback that users give and the checkout option to checkout.
40
5.2 DISCUSSION:

Hotel Management System Design


Room Management
 Room Registration: Add rooms with details like room number, type (single, double,
suite), price per night, and availability status.
 Display Rooms: List all rooms with details and their availability status.
 Update Availability: Mark a room as available or unavailable.
Guest Management
 Registration: Guests register with details such as name, contact information, and ID.
 Display Guests: List all registered guests.
Reservation Management
 Booking Request: Guests request room reservations by specifying check-in and check-
out dates.
 Room Matching: Matches an available room to the guest’s request.
 Booking Confirmation: Confirms the reservation and generates a unique reservation ID.
Billing and Payment
 Bill Generation: Calculates the total bill based on room price and the number of
nights stayed.
 Payment Processing: Processes the payment and updates the reservation status.

5.3 APPLICATION

Room Management
 Registration of Rooms: Allows the hotel staff to add new rooms into the system with
details such as room number, type (single, double, suite), price per night, and availability
status.
 Display and Update Room Status: Hotel staff can view all rooms along with their
availability status. They can also update the status of the rooms (available or unavailable).
Guest Management
 Guest Registration: Allows the hotel to register guests with their details such as name,
41
contact information, and ID.
 Display Guest Information: Hotel staff can view the list of all registered guests.

Reservation Management
 Room Booking: Guests can book rooms by providing check-in and check-out dates. The
system will match available rooms and confirm reservations.
 Reservation Confirmation: Provides a unique reservation ID for each booking and stores
reservation details such as check-in and check-out dates, guest information, and room
assigned.
Billing and Payment
 Bill Calculation: Calculates the total bill based on the room price per night and the number
of nights stayed.
 Payment Processing: Handles the payment process and updates the reservation status once
payment is made.
Reports and Analysis
 Occupancy Reports: Provides reports on room occupancy, which helps in understanding
the room utilization.
 Revenue Reports: Generates revenue reports based on room bookings and services provide

42
CHAPTER 6

CONCLUSION

In conclusion, the Hotel Management System developed in C significantly enhances the efficiency and
accuracy of hotel operations by automating critical processes such as room management, guest
registration, reservation handling, and billing. This system not only reduces manual workload but also
minimizes errors, thereby improving overall service quality. Key benefits include streamlined operations,
accurate billing, and improved guest experience.

References:
1. www.wikipedia.org/
2. www.Google.com
3. www.beginnersbook.com
4. https://youtube.com

43

You might also like