OOP (Microproject)
OOP (Microproject)
Micro-Project Report on
Submitted by: -
Sr Name Enroll No
No
1 Mansi Siddhanti 2006113
2 Sakshi Sonawane 2006116
3 Vaishnavi Thakur 2006137
1
GOVERNMENT POLYTECHNIC PUNE
(An Autonomous Institute of Government of Maharashtra)
CERTIFICATE
This is to certify that the mini-project work entitled “MICRO PROJECT TITLE” is bona
-fide work carried out by
Mansi Siddhanti 2006113
Sakshi Sonawane 2006116
Aditi Yewate 2006137
of class Second Year in partial fulfillment of the requirement for the completion of the
course- Object-Oriented Programming: C++ (CM3104/CM388)-EVEN2020 of Diploma in
Computer Engineering from Government Polytechnic, Pune. The report has been approved
as it satisfies the academic requirements in respect of micro-project work prescribed for the
course.
……………………… …………………………
Mrs. Saraswati panchakshari Mr. Nikam Sir
Micro-Project Guide Head of the Department
……………...…………………………
Dr. Vitthal Bandal
2
PROBLEM STATEMENT:-
To Study and Write a for the hostel management system.
PROBLEM DEFINITION:-
The hotel management system is designed to manage all hotel
activities like hostel menu, customers, room, staff allotment, and hotel
stores & generates related reports for smooth transactions. It is also
used to manage monthly mess bill calculation, hostel staff payroll,
student certificates, etc.
The aim of the Hotel Management System is to carry out the
activities of the Hotel in an efficient way. It will take the operations of
the Hotel to an upper level by providing faster access to data and
allowing addition, up-gradation, modification, and deletion of data in
a very systematic and reliable manner.
HARDWARE SPECIFICATION:-
Device: Lenovo i3
RAM: 8 GB
PLATFORM:
Turbo c++
Microsoft Word
3
ACKNOWLEDGEMENT
This amongst a wide panorama of people who provided me inspiring guidance and
encouragement, I take opportunity to thanks those who gave indebted assistance for
completing project.
I humbly wish to extend my cordial gratitude with profound thanks to my project guide for
his/her meticulous planning, valuable guidance, constant encouragement, and the invaluable
time he spent with me discussing each aspect of my project.
My heartfelt thanks for my dearest and loving parents for all their love, care and affection.
I’m thankful to them for standing by me like a strong pillar in failures and success.
4
Index
Contents
01. Abstract 6
02. Introduction 7
04. Results 21
06. conclusion 25
07 Referces 26
5
ABSTRACT
6
INTRODUCTION
C++, as we all know is an extension of C language and was developed by Bjarne
Stroustrup at bell labs. C++ is an intermediate-level language, as it comprises a confirmation
of both high-level and low-level language features. C++ is a statically typed, free form,
multiparadigm, compiled general-purpose language.
A hotel management system is a software system where the management of the entire hotel is
computerized. In this project the details are maintained like customer details, reservation
details, room availability, etc. this project can be viewed completely and the head of the
management can daily and, monthly review it. This project includes features like
7
It covers macros, classes, objects, arrays, functions, loops, and
structure in this project for C++ novices. When this code is launched,
the user is presented with a menu with seven options numbered 1
through 7, after which the program executes according to the user's
choices. The output from the g++ compiler may be seen at the bottom
of this page.
8
Program code
#include<iostream.h>
#include<string.h>
#include<conio.h>
#include<process.h>
#define max 100
//Class Customer
class Customer
{
public:
char name[100];
char address[100];
char phone[12];
charfrom_date[20];
charto_date[20];
floatpayment_advance;
intbooking_id;
};
class Room
{
public:
char type;
charstype;
char ac;
introomNumber;
int rent;
int status;
class Customer cust;
class Room addRoom(int);
voidsearchRoom(int);
9
voiddeleteRoom(int);
voiddisplayRoom(Room);
};
//Global Declarations
class Room rooms[max];
int count=0;
Room Room::addRoom(intrno)
{
class Room room;
room.roomNumber=rno; cout<<"\
nType AC/Non-AC (A/N) : ";
cin>>room.ac;
cout<<"\nType Comfort (S/N) : ";
cin>>room.type;
cout<<"\nType Size (B/S) : ";
cin>>room.stype; cout<<"\
nDaily Rent : ";
cin>>room.rent;
room.status=0;
cout<<"\n Room Added Successfully!";
getch();
return room;
}
void Room::searchRoom(intrno)
{
inti,found=0;
for(i=0;i<count;i++)
{
if(rooms[i].roomNumber==rno)
{
found=1;
break;
10
}
}
if(found==1)
{
cout<<"Room Details\n";
if(rooms[i].status==1)
{
cout<<"\nRoom is Reserved";
}
else
{
cout<<"\nRoom is available";
}
displayRoom(rooms[i]);
getch();
}
else
{
cout<<"\nRoom not found";
getch();
}
}
void Room::displayRoom(Room tempRoom)
{
cout<<"\n \n";
cout<<"\nRoom Number: \t"<<tempRoom.roomNumber;
cout<<"\nType AC/Non-AC (A/N) "<<tempRoom.ac;
cout<<"\nType Comfort (S/N) "<<tempRoom.type;
cout<<"\nType Size (B/S) "<<tempRoom.stype;
cout<<"\nRent: "<<tempRoom.rent;
}
//hotel management class
11
classHotelMgnt:protected Room
{
public:
voidcheckIn();
voidgetAvailRoom();
voidsearchCustomer(char *);
voidcheckOut(int);
voidguestSummaryReport();
};
voidHotelMgnt::guestSummaryReport(){
if(count==0){
cout<<"\n No Guest in Hotel !!";
}
for(int i=0;i<count;i++)
{
if(rooms[i].status==1)
{
cout<<"\n \n";
cout<<"\n Customer First Name : "<<rooms[i].cust.name;
cout<<"\n Room Number : "<<rooms[i].roomNumber;
cout<<"\n Address (only city) : "<<rooms[i].cust.address;
cout<<"\n Phone : "<<rooms[i].cust.phone;
cout<<"\n \n";
}
}
getch();
}
//hotel management reservation of room
voidHotelMgnt::checkIn()
{
inti,found=0,rno;
class Room room;
12
cout<<"\nEnter Room number : ";
cin>>rno;
for(i=0;i<count;i++)
{
if(rooms[i].roomNumber==rno)
{
found=1;
break;
}
}
if(found==1)
{
if(rooms[i].status==1)
{
cout<<"\nRoom is already Booked";
getch();
return;
}
cout<<"\nEnter booking id: ";
cin>>rooms[i].cust.booking_id;
cout<<"\nEnter Customer Name (First Name): ";
cin>>rooms[i].cust.name;
cout<<"\nEnter Address (only city): ";
cin>>rooms[i].cust.address; cout<<"\
nEnter Phone: ";
cin>>rooms[i].cust.phone; cout<<"\
nEnter From Date: ";
cin>>rooms[i].cust.from_date;
cout<<"\nEnter to Date: ";
cin>>rooms[i].cust.to_date; cout<<"\
nEnter Advance Payment: ";
cin>>rooms[i].cust.payment_advance;
13
rooms[i].status=1;
cout<<"\n Customer Checked-in Successfully..";
getch();
}
}
//hotel management shows available rooms
voidHotelMgnt::getAvailRoom()
{
inti,found=0;
for(i=0;i<count;i++)
{
if(rooms[i].status==0)
{
displayRoom(rooms[i]); cout<<"\n\
nPress enter for next room"; found=1;
getch();
}
}
if(found==0)
{
cout<<"\nAll rooms are reserved";
getch();
}
}
//hotel management shows all persons that have booked room
voidHotelMgnt::searchCustomer(char *pname)
{
inti,found=0;
for(i=0;i<count;i++)
{
if(rooms[i].status==1 &&stricmp(rooms[i].cust.name,pname)==0)
14
{
cout<<"\nCustomer Name: "<<rooms[i].cust.name;
cout<<"\nRoomNumber: "<<rooms[i].roomNumber;
cout<<"\n\nPress enter for next record";
found=1;
getch();
}
}
if(found==0)
{
cout<<"\nPerson not found.";
getch();
}
}
//hotel managemt generates the bill of the expenses
voidHotelMgnt::checkOut(introomNum)
{
inti,found=0,days,rno;
floatbillAmount=0;
for(i=0;i<count;i++)
{
if(rooms[i].status==1 && rooms[i].roomNumber==roomNum)
{
//rno = rooms[i].roomNumber;
found=1;
//getch();
break;
}
}
if(found==1)
{
cout<<"\nEnter Number of Days:\t";
15
cin>>days;
billAmount=days * rooms[i].rent;
cout<<"\n \n";
cout<<"\n\\t\t\t######## CheckOut Details ########\n"; cout<<"\
nCustomer Name : "<<rooms[i].cust.name;
cout<<"\nRoom Number : "<<rooms[i].roomNumber;
cout<<"\nAddress : "<<rooms[i].cust.address;
cout<<"\nPhone : "<<rooms[i].cust.phone; cout<<"\
nTotal Amount Due : "<<billAmount<<" /";
cout<<"\nAdvance Paid: "<<rooms[i].cust.payment_advance<<" /";
cout<<"\n*** Total Payable: "<<billAmount-rooms[i].cust.payment_advance<<"/ only";
rooms[i].status=0;
}
getch();
}
//managing rooms (adding and searching available rooms)
voidmanageRooms()
{
class Room room;
intopt,rno,i,flag=0;
charch;
do
{
//system("cls");
cout<<"\n\t\t\----- ### Manage Rooms ###-----\n";
cout<<"\n1. Add Room";
cout<<"\n2. Search Room";
cout<<"\n3. Back to main menu ";
cout<<"\n \n";
cout<<"\n\nEnter Option: ";
cin>>opt;
//switch statement
16
switch(opt)
{
case 1:
cout<<"\nEnter Room Number: ";
cin>>rno;
i=0;
for(i=0;i<count;i++)
{
if(rooms[i].roomNumber==rno)
{
flag=1;
}
}
if(flag==1)
{
cout<<"\nRoom Number is Present.\nPlease enter unique Number";
flag=0;
getch();
}
else
{
rooms[count]=room.addRoom(rno);
count++;
}
break;
case 2:
cout<<"\nEnter room number: ";
cin>>rno;
room.searchRoom(rno);
break;
case 3:
break;
17
default:
cout<<"\nPlease Enter correct option";
break;
}
}while(opt!=3);
}
void main()
{
classHotelMgnthm;
inti,j,opt,rno;
charch;
charpname[100];
do
{
clrscr();
cout<<"\n \n";
cout<<"\n\n\t\t ********* Hotel Management **********\n";
cout<<"\n \n";
cout<<"\n1. Manage Rooms";
cout<<"\n2. Book a Room";
cout<<"\n3. Available Rooms";
cout<<"\n4. Search Customer";
cout<<"\n5. Check-Out Room";
cout<<"\n6. Guest summary report";
cout<<"\n7. Exit";
cout<<"\n
_\n";
cout<<"\n\nEnter Option: ";
cin>>opt;
switch(opt)
{
case 1:
18
manageRooms();
break;
case 2:
if(count==0)
{
cout<<"\nRooms data is not available.\nPlease add the rooms first.";
getch();
}
else
hm.checkIn();
break;
case 3:
if(count==0)
{
cout<<"\nRooms data is not available.\nPlease add the rooms first.";
getch();
}
else
hm.getAvailRoom();
break;
case 4:
if(count==0)
{
cout<<"\nRooms are not available.\nPlease add the rooms first.";
getch();
}
else
{
cout<<"Enter Customer Name: ";
cin>>pname;
hm.searchCustomer(pname);
}
19
break;
case 5:
if(count==0)
{
cout<<"\nRooms are not available.\nPlease add the rooms first.";
getch();
}
else
{
cout<<"Enter Room Number : ";
cin>>rno;
hm.checkOut(rno);
}
break;
case 6:
hm.guestSummaryReport();
break;
case 7:
cout<<"\nTHANK YOU! FOR USING SOFTWARE";
cout<<"\n Press Enter key to exit application";
break;
default:
cout<<"\nPlease Enter correct option";
break;
}
}while(opt!=7);
getch();
}
20
RESULTS:
21
22
23
24
OUTCOMES ACHIEVED
Conclusion: -
In this micro project, we successfully designed a
Hotel Management System with the help of various
mathematical functions using c++ language. We tried to
build a user-friendly Hotel management system that
anyone can easily use. This particular project deals with the
problems of managing a hostel and avoids the problems which
occur when carried out manually.
25
References: -
Book Object-oriented programming with C++
Website https://www.geeksforgeeks.org/hotel-management-system/
Link https://www.cppbuzz.com/projects/c++/c++-project-on-hotel-
management
26