0% found this document useful (0 votes)
13 views14 pages

Report On Hotel Room Management System FOP

The document outlines a hotel management system project developed by students at the Shaheed Zulfikar Ali Bhutto Institute of Science & Technology. It details the program's objectives, workflow, features, and implementation, emphasizing its modular design and user-friendly features such as booking management and discounts. The report concludes with potential improvements and highlights the program's efficiency in managing hotel room bookings.

Uploaded by

bscs1c2412248
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)
13 views14 pages

Report On Hotel Room Management System FOP

The document outlines a hotel management system project developed by students at the Shaheed Zulfikar Ali Bhutto Institute of Science & Technology. It details the program's objectives, workflow, features, and implementation, emphasizing its modular design and user-friendly features such as booking management and discounts. The report concludes with potential improvements and highlights the program's efficiency in managing hotel room bookings.

Uploaded by

bscs1c2412248
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/ 14

Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

Total Marks: ________


Date: 1st January, 2024

Fundamentals Of
Programming
FOP
Hotel Management System
Project#02
Report

Submitted To: Ma’am Saira Shaheen


NAME REGISTRATION NUMBER

Sameera Ahmed 2412261

Hammas Ahmad 2412224

Ali Ahmed 2412216

Muhammad Rizwan 2412248

Hibah Asif 2412228

pg. 1
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

Introduction
The program is a well-structured hotel room management system designed to streamline the
process of handling room bookings, customer check-ins, check-outs, and viewing room status.
The code demonstrates clean and efficient practices, making it both scalable and maintainable.

Objectives
Following are the objectives:

 Create an easy-to-use hotel room management system that simplifies the booking process
for both guests and staff.
 Organize the handling of room bookings, check-ins, check-outs, and room statuses to
make operations smooth and efficient.
 Ensure reliable data management and reduce mistakes by using robust input validation
techniques.
 Enhance the customer experience with thoughtful features, such as the ability to input full
names and enjoy automated discounts during special occasions like New Year.
 Build a flexible system that can be easily updated with new features, such as seasonal
pricing or saving data for future use.
 Apply core programming concepts, including structured data, modular design, and error
handling, to ensure a clean, maintainable, and scalable solution.

Workflow
1. Initialization:
o The program starts by setting up a list of rooms with default values such as room
number, booking status (not booked), and a price of $250 per day.
2. User Menu:
o The user is presented with a menu offering four choices:

1. Check-In
2. Check-Out
3. Show Room Status
4. Exit

pg. 2
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

3. Room Management:
o Check-In:

1. The user provides a room number and the number of days for the stay.
2. If the room is available, the customer name is recorded, and the total price
is calculated. If it is New Year, a 10% discount is applied.
o Check-Out:

1. The room's booking status is cleared, and the customer name is reset. A
thank-you message is displayed.
o Room Status Display:

1. All room statuses are shown, indicating whether a room is available or


booked and the name of the customer, if applicable.

4. Input Validation:
o The program checks for valid room numbers and ensures menu choices are within
range, minimizing errors.
5. Exit:
o The user can choose to exit, ending the program.

Features and Implementation

1. Using Structures:
The program uses a struct to store room details like room number, booking status,
customer name, and daily price. This keeps things organized and avoids repeating
information.
2. Managing Rooms with Arrays:
An array of Room structs is used to handle multiple rooms. This makes it easy to work
with many rooms and add more if needed.

pg. 3
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

3. Breaking into Functions:


The program is divided into small parts like initializeRooms, checkIn, checkOut, and
showRoomStatus. This makes the code easier to understand and update.
4. Handling Names Easily:
The program uses std::string to accept customer names with multiple words, making it
more user-friendly.
5. New Year Discount:
A special feature gives a 10% discount on room bookings during the New Year, showing
how the program includes real-world business rules.
6. Showing Room Status:
A loop goes through the array of rooms to display their current status, making it simple to
handle more rooms if added.
7. Checking Input for Errors:
The program checks for valid room numbers and menu choices to prevent mistakes and
keep things running smoothly.
8. Using References:
The program uses references to quickly access and update room details in the array.

Advantages of the Approach

 Organization: The use of structures and arrays keeps the data manageable and logically
organized.
 Flexibility: Adding or modifying rooms is straightforward, as the code is built with
scalability in mind.
 User Experience: Features like multi-word customer names and discount logic enhance
the program's practical usability.
 Maintainability: Modular functions and a clean layout make it easy to debug and extend
the program.

pg. 4
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

Potential Improvements

 Flexible Room Pricing:


The price per day can change depending on the room type or the season.

 Saving Data with Files:


Using file handling to save and load room information would make the program more
useful and realistic.

 Better User Interface:


Adding a graphical interface (GUI) or clearer input prompts could make the program
easier and more enjoyable to use.

Conclusion
This program provides an efficient way to manage a small hotel's room bookings. It is simple to
use and ensures data consistency through structured management. The inclusion of discounts and
error handling enhances user experience and reliability.

Summary
The program initializes hotel rooms and offers options to check in, check out, and view room
statuses. It uses simple logic to handle bookings, calculates pricing with discounts, and validates
user input to prevent errors. The design is modular, making it easy to extend with new features in
the future.

Code:
#include <iostream>
#include <string>

pg. 5
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

using namespace std;


struct Room
{
int number;
bool isBooked;
string customerName;
double pricePerDay;
};
void initializeRooms(Room rooms[], int size)
{
for (int i = 0; i < size; ++i)
{
rooms[i].number = i + 1;
rooms[i].isBooked = false;
rooms[i].customerName = "";
rooms[i].pricePerDay = 250.0;
}
}
void checkIn(Room rooms[], int roomNumber, int days, bool isNewYear)
{
Room& room = rooms[roomNumber - 1];
if (room.isBooked)
{
cout << "Room " << room.number << " is already booked.\n";
}

pg. 6
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

else
{
room.isBooked = true;
cout << "Enter customer name: ";
cin >> room.customerName;
double totalPrice = room.pricePerDay * days;
if (isNewYear) {
totalPrice *= 0.9;
cout << "New Year discount applied! 10% off.\n";
}

cout << "Room " << room.number << " booked for " << room.customerName
<< " for " << days << " days.\n";
cout << "Total price: $" << totalPrice << "\n";
}
}
void checkOut(Room rooms[], int roomNumber)
{
Room& room = rooms[roomNumber - 1];
if (!room.isBooked) {

cout << "Room " << room.number << " is not booked.\n";
}
else
{
room.isBooked = false;

pg. 7
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

cout << "Room " << room.number << " checked out. Thank you, "
<< room.customerName << "!\n";
room.customerName = "";
}
}
void showRoomStatus(Room rooms[], int size)
{
for (int i = 0; i < size; ++i)
{
Room& room = rooms[i];
cout << "Room " << room.number << ": ";
if (room.isBooked)
{
cout << "Booked by " << room.customerName << "\n";
}
else
{
cout << "Available\n";
}
}
}

int main()
{
const int totalRooms = 3;

pg. 8
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

const bool isNewYear = true;


Room rooms[totalRooms];

initializeRooms(rooms, totalRooms);

bool running = true;


while (running)
{
cout << "\n1. Check-In\n2. Check-Out\n3. Show Room Status\n4. Exit\n";
cout << "Enter your choice: ";
int choice;
cin >> choice;

if (choice == 1)
{
int roomNumber, days;
cout << "Enter room number (1-" << totalRooms << "): ";
cin >> roomNumber;
if (roomNumber < 1 || roomNumber > totalRooms)
{
cout << "Invalid room number. Try again.\n";
}
else
{
cout << "Enter number of days: ";

pg. 9
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

cin >> days;


checkIn(rooms, roomNumber, days, isNewYear);
}
}
else if (choice == 2)
{
int roomNumber;
cout << "Enter room number (1-" << totalRooms << "): ";
cin >> roomNumber;
if (roomNumber < 1 || roomNumber > totalRooms)
{
cout << "Invalid room number. Try again.\n";
}
else
{
checkOut(rooms, roomNumber);
}
}
else if (choice == 3)
{
showRoomStatus(rooms, totalRooms);
}
else if (choice == 4)
{
cout << "Exiting. Thank you!\n";

pg. 10
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

running = false;
}
else
{
cout << "Invalid choice. Please try again.\n";
}
}

return 0;
}

Screenshot of the code in Dev C++

pg. 11
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

pg. 12
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

pg. 13
Shaheed Zulfikar Ali Bhutto Institute of Science &Technology

COMPUTER SCIENCE DEPARTMENT

Screenshot of the output

pg. 14

You might also like