You are on page 1of 29

PROJECT REPORT

HOTEL MANAGEMENT
(PROGRAMMING FUNDAMENTALS)

BS (CS/SE) 2017

Group Member(s):
Name: HIRA DANISH Enrolment 2017/BS (SE)/21601
Name: SOMIA ANJUM Enrolment 2017/BS (SE)/21633
Name: MAHNOOR MUZZAMIAL Enrolment 2017/BS (SE)/21615
Name: FATIMA KHAN Enrolment 2017/BS (SE)/21594
NAME: HADIQA HANIF Enrolment 2017/BS (SE)/21595

2nd May 2017

DEPARTMENT OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY


JINNAH UNIVERSITY FOR WOMEN
5-C NAZIMABAD, KARACHI 74600
OVERVIEW:

There are so many facilities in this hotel where every customer stay for
several days.

DEFINING THE PROGRAM:

Process to reserve and cancel the reservation of room for the user input
days including the proper record of costumer.

PSEUDOCODE:

1. Print facilities of our hotel i.e. power backup, automatic lift, parking space,
clock security, running hot and cold water, free internet service, 24 hours room
service, and laundry service.

2. Now press any character to continue. If you press number 1 you will choose
super deluxe price Rs. 1500 if you press 2 you will choose deluxe price Rs. 1000
if you press 3 you will choose general Rs. 750 if you press 4 you will choose
couple Rs. 1000 if you press 5 you will choose couple deluxe price Rs. 1500.

3. Print room no., type, charges, availibility, costumer name, period. Print room
no. , advance, feature of this room in super deluxe is bed, capacity, balcony in
deluxe , general, couple, deluxe couple is bed and capacity additional features are
AC , geyser , TV. Print enter the no.in which you want to stay.

4. Enter name of costumer living, enter city name, enter nationality, how many
days costumer want the room, enter no. of group members.

5. If members cannot be allocated this room allowed members are between 1-5.

6. Print enter the date of arrival, year, month, date, day, room is allocated to
costumer for days.

7. Calculate the total bill by per room*charges-advance+total.

8 . Print the total bill and thanks for staying in this hotel.
ALGORITHM:

int advance[5]={750,500,400,500,750};
int r_no[5]={1,2,3,4,5};
int room;
tot[5]={0,0,0,0,0};
int g_tot=0;
int r_charge[5];
char r_type[5][7];
char r_cust[5][20]={"N.A","N.A","N.A","N.A","N.A"};
char c_city[5][20];
char name[30];
int c_mem[5];
char c_nat[5][20];
char r_avail[5];
int r_per[5];
int no[5];
int year[5];
int month[5];
int day[5];
int i;
for(i=0;i<5;i++)
if else
switch(typ)
if else
do
switch(ch)
while(ans=='y'||ans=='Y');

FLOWCHART
CODING

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process.h>
#include<graphics.h>
#include<stdlib.h>
#include<dos.h>
int advance[5]={750,500,400,500,750};
int r_no[5]={1,2,3,4,5};
int room;
tot[5]={0,0,0,0,0};
int g_tot=0;
int r_charge[5];
char r_type[5][7];
char r_cust[5][20]={"N.A","N.A","N.A","N.A","N.A"};
char c_city[5][20];
char name[30];
int c_mem[5];
char c_nat[5][20];
char r_avail[5];
int r_per[5];
int no[5];
int year[5];
int month[5];
int day[5];
int i;
void getavail();
void putavail();
void features();
void allocate();
void putcust();
void deallocate();
void cancel();
void intro();
void screenheader();
void screenheader()
{

int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
x=getmaxx()/2;
y=getmaxy()/2;
for(i=30;i<200;i++)
{
delay(100);
setcolor(i/10);
arc(x,y,0,180,i-10);
setbkcolor(CYAN);
getch();
}
closegraph();
return;
}
void intro()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setbkcolor(LIGHTBLUE);
printf("\n\t\tDHA. Road,karachi,Sindh 00000,PAKISTAN\n");
printf("\t\t\tPh. No.:021-3333333\n");
printf("\t\t\tWELCOMES TO OUR\n");
printf("\t\tRAINBOW is one of the best Hotel in karachi. The Hotel is
equipped with all the general amenities and facilities that go along with
memorable stay,\n");
printf("\n\t\t\t\t\t\t\t\t\t\t\t\t\t AMENITIES .......\n");
printf("\t\t\t1. Power backup.\n");
printf("\t\t\t2. Automatic lift.\n");
printf("\t\t\t3. parking space.\n");
printf("\t\t\t4. Clock security.\n");
printf("\t\t\t5. Running hot and cold water.\n");
printf("\t\t\t6. Free internet service.\n");
printf("\t\t\t7. 24 hours room service.\n");
printf("\t\t\t8. Laundary service.\n");
printf("\nPress any character to continue:");
getch();
closegraph();
return;
}
void getavail()
{
screenheader();

for(i=0;i<5;i++)
{
if(r_no[i]==1)
{
strcpy(r_type[i],"Sp Dlx");
r_charge[i]=1500;
if(strcmp(r_cust[i],"N.A")==0)
{
r_avail[i]='Y';
r_per[i]=0;
}
}
else if(r_no[i]==2)
{
strcpy(r_type[i],"Dlx");
r_charge[i]=1000;
if(strcmp(r_cust[i],"N.A")==0)
{
r_avail[i]='Y';
r_per[i]=0;
}
}
else if(r_no[i]==3)
{
strcpy(r_type[i],"Gen");
r_charge[i]=750;
if(strcmp(r_cust[i],"N.A")==0)
{
r_avail[i]='Y';
r_per[i]=0;
}
}
else if(r_no[i]==4)
{
strcpy(r_type[i],"Couple");
r_charge[i]=1000;
if(strcmp(r_cust[i],"N.A")==0)
{
r_avail[i]='Y';
r_per[i]=0;
}
}
else if(r_no[i]==5)
{
strcpy(r_type[i],"C Dlx");
r_charge[i]=1500;
if(strcmp(r_cust[i],"N.A")==0)
{
r_avail[i]='Y';
r_per[i]=0;
}
}
}
}
void putavail()
{
clrscr();
screenheader();
printf("\n ROOM AVAILABILITY");
printf("\n -------------------");
printf("\nRoom No| Type | Charge | Availability | Cust_Name | Period
|");
for(i=0;i<5;i++)
{
printf("\n%d\t",r_no[i]);
cputs(r_type[i]);
if(i==0)
printf(" %d\t%c\t ",r_charge[i],r_avail[i]);
if((i==1) || (i==2))
printf(" %d\t %c\t ",r_charge[i],r_avail[i]);
if(i==3 || i==4)
printf(" %d\t %c\t ",r_charge[i],r_avail[i]);
cputs(r_cust[i]);
if((i==1) || (i==2))
printf("\t %d",r_per[i]);
else if((i==3) || (i==4))
printf("\t %d",r_per[i]);
else
printf("\t %d",r_per[i]);
}
}
void features()
{
int typ;
clrscr();
screenheader();
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setbkcolor(GREEN);
printf("\nChoose the room type:\n1. Sp. Delux\n2. Delux");
printf("\n3. General\n4. Couple\n5. C. Delux\n");
scanf("%d",&typ);
if(typ>5)
{
printf("\nWrong choice!! Choose a number between 1-5:");
features();
}
switch(typ)
{
case 1:clrscr();
screenheader();
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setbkcolor(GREEN);
printf("\n Room number >>>1");
printf("\n Advance >>>750\n\n");
printf("\n FEATURES OF THIS ROOM ");
printf("\n------------------------------------------------------------------");
printf("\n\n Room Type >>> Sp.delux");
printf("\n\n Room charges >>> Rs.1500 per day");
printf("\n\n 1. Bed >>> 2");
printf("\n\n 2.Capacity >>> 5");
printf("\n\n 3.Balcony available ");
printf("\n------------------------------------------------------------------");
printf("\n ADDITIONAL FEATURES ");
printf("\n------------------------------------------------------------------");
printf("\n\n 1.A/C available ");
printf("\n\n 2.Geyser available");
printf("\n\n 3.TV available ");
printf("\n-----------------------------------------------------------------");
break;
case 2:clrscr();
screenheader();
printf("\n Room number >>>2\n\n");
printf("\n Advance >>>500\n\n");
printf("\n FEATURES OF THIS ROOM ");
printf("\n-------------------------------------------------------------------");
printf("\n\n Room Type >>> Delux ");
printf("\n\n Room charges >>>Rs.1000 per day");
printf("\n\n 1. Bed >>> 2");
printf("\n\n 2.Capacity >>> 5");
printf("\n-------------------------------------------------------------------");
printf("\n ADDITIONAL FEATURES ");
printf("\n-------------------------------------------------------------------");
printf("\n\n 1.A/C available ");
printf("\n\n 2.Geyser available");
printf("\n\n 3.TV available ");
printf("\n-------------------------------------------------------------------");
break;
case 3:clrscr();
screenheader();
printf("\n Room number >>>3\n\n");
printf("\n Advance >>>400\n\n");
printf("\n FEATURES OF THIS ROOM ");
printf("\n-------------------------------------------------------------------");
printf("\n\n Room Type >>> General ");
printf("\n\n Room charges >>>Rs.750 per day");
printf("\n\n 1. Bed >>> 2");
printf("\n\n 2.Capacity >>> 5");
printf("\n-------------------------------------------------------------------");
printf("\n ADDITIONAL FEATURES ");
printf("\n-------------------------------------------------------------------");
printf("\n\n 1.Geyser available ");
printf("\n-------------------------------------------------------------------");
break;
case 4:clrscr();
screenheader();
printf("\n Room number >>>4\n\n");
printf("\n Advance >>>500\n\n");
printf("\n FEATURES OF THIS ROOM ");
printf("\n-------------------------------------------------------------------");
printf("\n\n Room Type >>> Couple ");
printf("\n\n Room charges >>>Rs.1000 per day");
printf("\n\n 1. Bed >>> 1");
printf("\n\n 2.Capacity >>> 2");
printf("\n-------------------------------------------------------------------");
printf("\n ADDITIONAL FEATURES ");
printf("\n-------------------------------------------------------------------");
printf("\n\n 1.Geyser available");
printf("\n\n 2.TV available ");
printf("\n-------------------------------------------------------------------");
break;
case 5:clrscr();
screenheader();
printf("\n Room number >>>5\n\n");
printf("\n Advance >>>750\n\n");
printf("\n FEATURES OF THIS ROOM ");
printf("\n-------------------------------------------------------------------");
printf("\n\n Room Type >>> Couple Delux
");
printf("\n\n Room charges >>>Rs.1500 per day");
printf("\n\n 1. Bed >>> 1");
printf("\n\n 2.Capacity >>> 2");
printf("\n-------------------------------------------------------------------");
printf("\n ADDITIONAL FEATURES ");
printf("\n-------------------------------------------------------------------");
printf("\n\n 1.A/C available ");
printf("\n\n 2.Geyser available");
printf("\n\n 3.TV available ");
printf("\n-------------------------------------------------------------------");
break;
}
getch();
closegraph();
return;
}
void allocate()
{
clrscr();
getavail();
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setbkcolor(LIGHTBLUE);
printf("\n Enter the room number in which you want to stay:");
scanf("%d",&room);
if(r_avail[room-1]=='Y')
{
fflush(stdin);
printf("\n Enter Name of cust living :");
gets(r_cust[room-1]);
printf("\n Enter city name :");
gets(c_city[room-1]);
printf("\n Enter nationality :");
gets(c_nat[room-1]);
printf("\n For how many days cust want the room :");
scanf("%d",&r_per[room-1]);
printf("\n Enter no. of member in your group :");
scanf("%d",&c_mem[room-1]);
if((room==1)||(room==2)||(room==3))
if((c_mem[room-1]<1)||(c_mem[room-1]>5))
{
printf("\n %d members cannot be allocated this room.Allowed
members are between 1-5.",c_mem[room-1]);
getch();
allocate();
}
else if((room==4)||(room==5))
if((c_mem[room-1]<1)||(c_mem[room-1]>2))
{
printf("\n %d members cannot be allocated this room.Allowed
members are between 1-2.",c_mem[room-1]);
getch();
allocate();
}
printf("\n Enter the date of arrival :");
printf("\n------------------------------");
printf("\n Year : ");
scanf("%d",&year[room-1]);
printf("\n Month :");
scanf("%d",&month[room-1]);
printf("\n Day :");
scanf("%d",&day[room-1]);
if((year[room-1]>9999)||(month[room-1]>12)||(month[room-
1]<1)||(day[room-1]<1)||(((month[room-1]==1)||(month[room-
1]==3)||(month[room-1]==5)||(month[room-1]==7)||(month[room-
1]==8)||(month[room-1]==10)||(month[room-1]==12))&&(day[room-
1]>31))||(((month[room-1]==4)||(month[room-1]==6)||(month[room-
1]==9)||(month[room-1]==11))&&(day[room-1]>30))||((month[room-
1]==2)&&((year[room-1]%400==0)||((year[room-
1]%4==0)&&(year[room-1]%100!=0)))&&(day[room-
1]>29))||((month[room-1]==2)&&(year[room-1]%4!=0)&&(day[room-
1]>28)))
{

printf("\n\n!!!!!INVALID DATE........");
getch();
allocate();
}
else
{
printf("\n... Room is allocated to ");
cputs(r_cust[room-1]);
printf(" for %d days.",r_per[room-1]);
r_avail[room-1]='N';
}
}
else
{
printf("\n ERROR : Room cannot be allocated ...");
printf("\n Room is not available...");
}
getch();
closegraph();
return;
}
void deallocate()
{
clrscr();
screenheader();
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setbkcolor(GREEN);
printf("\nEnter the room number:");
scanf("%d",&room);
if(r_cust[room-1]=="N.A")
{
printf("\nThe room is empty........");
getch();
}
else
{
printf("\nEnter the name of the person staying in the room:");
fflush(stdin);
gets(name);
if(strcmpi(name,r_cust[room-1])==0)
{
printf("\nRoom number %d is deallocated......",room);
strcpy(r_cust[room-1],"N.A");
}
else
{
printf("\nInvalid name........");

deallocate();
}
}
g_tot=(r_per[room-1]*r_charge[room-1])-advance[room-1]+tot[room-
1];
printf("\n\nYour total bill is %d",g_tot);
printf("\n\n\nThanks for staying in this hotel.........");
getch();
closegraph();
return;
}
void cancel()
{
clrscr();
screenheader();
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setbkcolor(LIGHTBLUE);
printf("\nEnter the room number:");
scanf("%d",&room);
if(r_cust[room-1]=="N.A")
{
printf("\nThe room is empty........");
}
else
{
printf("\nEnter the name of the person staying in the room:");
fflush(stdin);
gets(name);
if(strcmpi(name,r_cust[room-1])==0)
{
printf("\nReservation for room number %d is cancelled......",room);
strcpy(r_cust[room-1],"N.A");
}
else
{
printf("\nInvalid name........");
cancel();
}
}
g_tot=advance[room-1];
printf("\n\nYour total bill is %d",g_tot);
getch();
closegraph();
return;
}
void putcust()
{
int j;
clrscr();
screenheader();
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setbkcolor(LIGHTGREEN);
printf("\nEnter the room number :");
scanf("%d",&room);
j=strcmp(r_cust[room-1],"N.A");
if(j==0)
{
printf("\n Data not available ");
}
else
{
printf("\n Room No :%d",r_no[room-1]);
printf("\n Customer Name :");
cputs(r_cust[room-1]);
printf("\n Period :%d",r_per[room-1]);
printf("\n City :");
cputs(c_city[room-1]);
printf("\n Nationality :");
cputs(c_nat[room-1]);
printf("\n No of member :%d",c_mem[room-1]);
printf("\n Arrival Date :%d/%d/%d",day[room-1],month[room-
1],year[room-1]);
}
getch();
closegraph();
return;
}
void main()
{
char ans;
int ch;
clrscr();
screenheader();
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setbkcolor(LIGHTBLUE);
intro();
do
{
clrscr();
screenheader();
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
setbkcolor(CYAN);
printf("\n\n\n Choose a category:\n");
printf(" 1. Get availability\n");
printf(" 2. Features of room\n");
printf(" 3. Room allocation\n");
printf(" 4. Show customer details\n");
printf(" 5. Cancellation\n");
printf(" 6. Room Deallocation\n");
printf(" 7. Exit\n");
scanf("%d",&ch);
switch(ch)
{
case 1:getavail();
putavail();
break;
case 2:features();
break;
case 3:allocate();
break;
case 4:putcust();
break;
case 5:cancel();
break;
case 6:deallocate();
break;
case 7: exit(0);
default:printf("\n\n\nWrong choice!!!!\n\nPlease choose 1-6");
getch();
closegraph();
return;
}
printf("\n\nDo you want to continue:");
fflush(stdin);
scanf("%c",&ans);
}while(ans=='y'||ans=='Y');
}
OUTPUT
TESTING THE PROBLEM

1.Gets error while including graphics because graphics library was not
managed.

2.Gets declaration error on random because stldib library was not included.

3.Gets declaration error on x,y,i.

4.printf prototype missing .

5.Compound error.

6. Statement missing.

You might also like