SIDDAGANGA INSTITUTE OF TECHNOLOGY,TUMAKURU
(An Autonomous institution affiliated to Visvesvaraya Technological University- Belagavi, Approved by AICTE,
Accredited by NAAC with ‘A++’ Grade, Awarded Diamond College Rating by QS I-GAUGE & ISO 9001:2015
certified )
MICRO PROJECT REPORT
ON
“Hotel Reservation”
BACHELOR OF ENGINEERING
In
ELECTRONICS AND COMMUNICATION ENGINEERING
SUBMITTED BY
NAME: USN:
OM TRIVEDI
1SI24EC075
SAGAR NAGALIKAR
1SI24EC089
SOUNAK GHOSH 1SI24EC105
SATVIK DAYANAND GEJJI 1SI24EC096
MOHAMMED K 1SI24EC069
Under the guidance of
Dr. MALA.S
Assistant Professor
Department of ECE
CONTENT
03
Abstract (1 Paragraph)
Introduction (2-3 pages) 04
Algorithm 06
Flow chart 10
Implementation 11
Results and Discussions
16
Inference (1 paragraph)
19
ABSTRACT
The Hotel Reservation System is a software application that allows customers
to easily book hotel rooms. The system enables users to view available rooms,
make reservations by providing their personal details, and check the status of
bookings. It also tracks the number of rooms booked and remaining
availability. The program offers a simple menu where users can select options
to book a room, view existing bookings, or check room availability. The main
goal of this system is to automate the reservation process and provide a
smooth user experience. It is designed to be easy to use for both hotel staff
and customers.
INTRODUCTION
In today’s digital world, automation has become an essential part of almost
every industry, and the hotel industry is no exception. One of the most
common and vital tasks in hotel management is handling room reservations.
Traditionally, room booking was done manually, where customers would either
walk in or call the hotel to inquire about room availability and make a
reservation. This manual process often led to confusion, overbooking,
miscommunication, and sometimes even loss of valuable customer data. In
order to overcome these limitations, a computerized system is needed to
handle hotel reservations more efficiently. This project introduces a basic Hotel
Reservation System programmed in the C language that simplifies the room
booking process for both hotel staff and customers.
The Hotel Reservation System presented here allows users to perform several
important functions: booking a room, viewing all existing bookings, and
checking room availability. These functionalities are essential for maintaining
an organized and error-free reservation system. The user interacts with the
system through a menu-driven interface that is simple and easy to understand.
The user can select the desired option from the menu, and the system
performs the corresponding operation. The program makes use of basic C
programming concepts and avoids the use of any user-defined data types,
making it highly suitable for beginners.
The booking process is straightforward. When a customer chooses to book a
room, the system collects basic personal details such as their name, address,
and phone number. Based on the current number of bookings, a room number
is automatically assigned to the customer. This removes the need for manual
tracking of room numbers and reduces the chances of double booking. All this
information is stored using parallel arrays. This approach simplifies data
management and keeps the program easy to understand and maintain.
For hotel staff or administrators, the ability to view all bookings is crucial. It
helps in managing room occupancy, tracking customer details, and planning
housekeeping and other services. In our system, the 'View Bookings' option
prints out a list of all current reservations, including the customer's name,
address, phone number, and the room number assigned to them. This can be
especially helpful during check-in and check-out processes, as well as in case of
customer queries.
Another key feature of the system is the 'Check Availability' function. This
allows users to know how many rooms are currently available for booking. The
total number of rooms is fixed, and every time a new booking is made, the
count of available rooms is updated accordingly. This real-time update ensures
that customers are only shown available rooms and prevents overbooking,
which can negatively affect the reputation of the hotel.
The entire system operates in a loop using a do-while structure, which means
that after completing any action, the user is brought back to the main menu.
This allows continuous interaction with the system until the user chooses to
exit. The menu-driven structure ensures that the program is user-friendly,
especially for those who are not technically skilled.
Although this system is basic in nature, it covers the core functionalities of a
real hotel reservation system. It can be further expanded by including features
such as room types (single, double, suite), date of booking, length of stay,
billing system, and even connecting it to a database for long-term data storage.
However, the simplicity of this version makes it an excellent starting point for
learning how software can be used to manage real-world tasks.
In summary, the Hotel Reservation System is a beginner-friendly C project that
demonstrates how basic programming logic can be applied to solve practical
problems. It eliminates the need for manual room booking, reduces human
error, and improves the overall efficiency of hotel operations. By using
fundamental programming constructs and a clean menu-based interface, this
project provides a solid foundation for more advanced systems in the future.
ALGORITHM
Here's a detailed algorithm for your Hotel Reservation System in C (without
using any user-defined data types), broken down into clear steps:
Step 1: Initialization
1. Define global arrays to store customer data:
name[50][50] – for storing names
address[50][100] – for storing addresses
phone[50][15] – for storing phone numbers
room[50] – for storing room numbers
2. Define an integer variable count = 0 to keep track of the number of
bookings.
3. Define a constant totalRooms = 50 representing total rooms in the hotel.
4. Declare choice for storing the user’s menu selection.
Step 2: Display Menu and Get User Choice
1. Use a do-while loop to repeat the process until the user chooses to exit
(choice == 4).
2. Inside the loop, display the menu:
1. Book a Room
2. View All Bookings
3. Check Room Availability
4. Exit
3. Prompt the user to enter their choice and read it using scanf.
Step 3: Perform Actions Based on User Choice
Use a switch(choice) structure to perform actions:
Case 1: Book a Room
1. Check if count < totalRooms:
If true:
Prompt the user to enter:
Name
Address
Phone number
Store these in the respective arrays at index count.
Assign room[count] = count + 1.
Increment count.
Display success message with room number.
If false:
Display message: “All rooms are booked.”
Case 2: View All Bookings
1. If count == 0, display: “No bookings yet.”
2. Otherwise:
Loop from i = 0 to count - 1:
Display room[i], name[i], address[i], and phone[i] for each booking.
Case 3: Check Room Availability
1. Calculate available = totalRooms - count.
2. Display the number of available rooms.
Case 4: Exit
1. Display a goodbye message.
2. Exit the loop.
Default: Invalid Choice
1. Display: “Invalid choice. Try again.”
Step 4: End of Program
The loop exits when the user enters 4.
Program terminates gracefully with a closing message.
FLOWCHART-:
IMPLEMENTATION
The implementation was structured in a modular way to ensure code clarity
and easy maintenance. Separate functions were created for different tasks like
booking a room, viewing all bookings, and checking room availability. The use
of functions improves readability and allows for code reuse.
To store customer details, parallel arrays were used. These arrays included:
• An array for names (name[50][50])
• An array for addresses (address[50][100])
• An array for phone numbers (phone[50][15])
• An integer array for room numbers (room[50])
A menu-driven interface was created using a do-while loop that continuously
displayed the main menu until the user chose to exit the program. The menu
had four options:
1. Book a Room
2. View All Bookings
3. Check Room Availability
4. Exit
The user selected an option by entering a number. A switch statement was
used to handle the user's choice and call the appropriate function.
Here’s a brief overview of each function:
• bookRoom(): Collects the user's personal details and stores them in the
arrays. It assigns a unique room number based on the current booking
count.
• viewBookings(): Displays all bookings stored in the arrays with customer
details.
• checkAvailability(): Calculates and displays how many rooms are still
available.
• main(): Controls the flow of the program using the menu and user input.
CODE-
#include <stdio.h>
#include <string.h>
#define MAX_CUSTOMERS 100
// Parallel arrays to store customer data
char names[MAX_CUSTOMERS][30];
char addresses[MAX_CUSTOMERS][100];
char phones[MAX_CUSTOMERS][15];
int room_numbers[MAX_CUSTOMERS];
int total_bookings = 0;
void bookRoom() {
if (total_bookings >= MAX_CUSTOMERS) {
printf("All rooms are booked.\n");
return;
}
printf("Enter Name: ");
scanf(" %[^\n]", names[total_bookings]);
printf("Enter Address: ");
scanf(" %[^\n]", addresses[total_bookings]);
printf("Enter Phone Number: ");
scanf(" %[^\n]", phones[total_bookings]);
room_numbers[total_bookings] = 100 + total_bookings;
printf("Room booked successfully. Room Number: %d\n",
room_numbers[total_bookings]);
total_bookings++;
}
void viewBookings() {
if (total_bookings == 0) {
printf("No bookings found.\n");
return;
}
for (int i = 0; i < total_bookings; i++) {
printf("\nCustomer %d:\n", i + 1);
printf("Name: %s\n", names[i]);
printf("Address: %s\n", addresses[i]);
printf("Phone: %s\n", phones[i]);
printf("Room Number: %d\n", room_numbers[i]);
}
}
void checkAvailability() {
printf("Total Rooms: %d\n", MAX_CUSTOMERS);
printf("Rooms Booked: %d\n", total_bookings);
printf("Rooms Available: %d\n", MAX_CUSTOMERS - total_bookings);
}
int main() {
int choice;
do {
printf("\n--- Hotel Reservation System ---\n");
printf("1. Book a Room\n");
printf("2. View All Bookings\n");
printf("3. Check Room Availability\n");
printf("4. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice) {
case 1:
bookRoom();
break;
case 2:
viewBookings();
break;
case 3:
checkAvailability();
break;
case 4:
printf("Exiting program. Goodbye!\n");
break;
default:
printf("Invalid choice. Try again.\n");
}
} while (choice != 4);
return 0;
}
RESULTS AND DISCUSSIONS
Here are the results for our project-
1)Booking:-
When a user chooses to book a room, the program prompts for their name,
address, and phone number.A room number is automatically assigned, and the
booking is stored successfully.
The program displays a confirmation message showing the room number
assigned.
2)Viewing all Bookings:-
When selected, the system lists all customer bookings made so far.It shows
details including the customer’s name, address, phone number, and the
assigned room number.
3) Checking Room Availability:-
This feature correctly calculates and displays the number of rooms already
booked and the number of rooms still available.It ensures that no more than
50 rooms can be booked, preventing overbooking.
DISCUSSION:-
The program meets the primary goal of automating a basic hotel reservation
system using only simple C programming constructs. It uses parallel arrays to
manage customer information and room assignments efficiently without using
advanced data structures like structs or pointers. This makes the project
beginner-friendly and easy to understand for students new to programming.
The menu-driven approach provides a smooth user experience, and the use of
a do-while loop allows the user to perform multiple operations without
restarting the program. By maintaining a booking count, the program keeps
accurate track of the rooms booked and available.
However, the current implementation has a few limitations:
The system does not handle input validation or incorrect data types (e.g.,
characters instead of numbers).
It does not support deleting or updating bookings.
The data is stored only in memory, so once the program ends, all bookings are
lost (no file or database storage).
Despite these limitations, the project fulfills the requirements of a mini-project
and clearly demonstrates how programming can simplify real-life tasks like
hotel management.
INFERENCE
The Hotel Reservation System project demonstrates how basic programming
concepts in C can be applied to solve real-life problems effectively. Through
this mini project, we successfully automated the process of booking and
managing hotel rooms using simple logic and array handling without any user-
defined data types. The program reduces manual effort, minimizes human
error, and provides a user-friendly interface for both customers and hotel staff.
It also lays a strong foundation for building more advanced systems with
additional features like billing, room categorization, and database integration.
This project proves that even basic-level code can create functional and useful
applications when structured properly.