PSP [20ES104] COURSE PROJECT REPORT
On
“HOTEL MANAGEMENT SYSTEM”
Developed By:
H.T.NO STUDENT NAME
2203A51172 D. Vishwa vardhini
2203A51179 K. Deepakraj
2205A41141 M. Varsha
2203A51167 B. Aditya
Under the Guidance of
Dr P PRAVEEN
Associate Professor
Submitted to
Department Computer Science and Artificial
Intelligence SR University
Ananthasagar(V), Hasanparthy(M), Hanamkonda(Dist.) – 506371
www.sru.edu.in
June 2023
Department of Computer Science and Artificial Intelligence
CERTIFICATE
This is to certify that the PSP course project report entitled “ Hotel Management
System” is a record of bonafide work carried out by the student(s) Vishwa Vardhini,
Deepakraj, Varsha & Aditya bearing roll number(s) 2203A51172, 2203A51179,
2205A41141 & 2203A51167 of Computer Science Engineering and Electronics
Communication Engineering departments during the academic year 2022-23.
Supervisor
(Dr P Praveen)
INDEX
Sl. No Title Page No.
1. Problem statement 1
2. Module-wise description 2
3. Knowledge required to develop the project 4
4. Source code (.c file code followed by .h file code) 5
5. Results 35
2205A41149 P. Akshitha
2205A41155 Y. Shashank
2205A41253 B. Revanth kumar
2205A41255 Sidra Samreen
PROBLEM STATEMENT:
Develop a C Application to store details of the Customer,
F, Transport, Residential, Admissions, Sports data…… in
terms of (Name , E-mail , Mobile.No ,, fees, Salaray, All
details……..).
Provide the functionality for below mentioned:
1. Read Customer details .
2. Arranging them in the branch wise order.
3. Giving everyone a unique login id.
4. Similarly reading ‘n’ Faculty details.
5. Details of all the Faculty.
6. Sort ‘n’ students details according to their respective
branches:
CSE
ECE
EEE
CIVIL
MECHANICAL
7. Print the ‘n’ students details according to :
Hallticket.no
Name
Course
Mobile.no
Email id
Year and Semester
Attendence
Grade
Fee details
Accomodation
8. Print ‘n’ Faculty details according to :
ID
Name
Subject
Mobile.no
Email id
Experience
Salary
Rating
Attendence
Accomodation
9. print all the sports available in the college according to:
Sport
Coach
No.of Courts
Area
10. Print the Transport facility to all the available places
accordingly:
Bus numbers
Type of Passengers
Route
11.Print the Hostel details according to:
No.of rooms
No.of floors
No.of hostels
No.of Wardens
No.of Students
No.of Restrooms
12. Print The employees data accoding to:
Duty
Gender
Salary
Accomodation
13. Print College details according to:
Area
No.of blocks
No.of labs
No.of class rooms
No.of students
No.of Faculty
No.of workers
No.of Grounds
No.of Libraries
No.of Canteens
14.Print the details and read the details dynamically
from the keyboard while admissions of students
according to:
Name
Course
Mobile.no
SSC marks
Intermediate Score
Eamcet Rank
Accomodation
Certificates
Fee details
MODULES:
In this application all variables and structure are declared
globally so that these variables and structure members
can be accessed throughout the program at any function
call. We can choose any function by using function calls
which are declared in switch-case. In order to repeat the
loop control statement (do-while) is used with condition.
The memory allocation will be done in this program
dynamically. The application asks the person who runs the
program that how many passengers data he/she want to
store.
In this application four modules are used.
1. Read/Input
Implement a text-based menu-driven interface for
interacting with the system.
Use input/output functions (e.g., printf, scanf) to display
and collect user information.
2. Sorting
In this module sorting of data is done according to the
chosen wise.
In this module there is a sub menu which asks to select
the sorting wise by using switch case. The sorting sub
menu will be like press 1 to sort by name wise press 2
to sort by age wise press 3 to sort aadhar number wise
press 4 to sort by berth wise 5 to sort by date of travel
wise press 6 to sort by train wise press 6 to sort train
name wise press 7 to sort by boarding station wise
press 8 to sort departing station wise.
In this module we used another control statement (do
while) so that the application asks whether to continue
sorting.
3. File Handling:
Store data in files to enable data persistence.
Use file handling functions (e.g., fopen, fwrite, fread) to
read and write data to files.
search by boarding station wise press 8 to search
departing station wise.
In this module we used another control statement (do
while) so that the application asks whether to continue
searching.
4. Print
In this module all the stored details of n customers will
be displayed on to the screen. In this module printf
function and for loop are used.
KNOWLEDGE REQUIRED TO DEVELOP THIS APPLICATION
Control Statements (if, if-else, switch)
Loop Statements (while/do while, for)
Arrays (1D/2D-arrays)
Functions (Any type of user defined functions)
Structure (structures and nested structures)
Pointers ( pointers to structures)
Files (To store the Customer details )
SOURCE CODE [.C FILE]:
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<time.h>
#include<stdlib.h>
void begin();
void show_details();
void book_room();
void food_menu();
struct
{
char name[20];
char address[50];
char email_id[30];
char nationality[25];
int ap,app,appp;
int roomno;int food;
char *roomtype;
int billprice,Total;
char *program;
}person;
int main()
{
person.roomno =0;
person.food =0;
person.billprice =0;
person.program = "notchosen";
printf(" ***********************");
printf("\n ||WELCOME TO SRU C2 HOTEL||\n");
printf(" ***********************\n");
printf(" \n\n");
printf("====* Enter Customer Details *====\n\n");
printf("please enter person name:");
gets(person.name);
printf("enter person address:");
gets(person.address);
printf("enter person nationality:");
gets(person.nationality);
printf("enter person email_id:");
gets(person.email_id);
printf("\n\n\t\t** Thank's Giving Your Details **\n\n\n ");
begin();
return 0;
}
void begin(void)
{
int decide;
printf("=> MAIN MENU\n");
printf(" =========\n");
printf("1.FOOD MENU CARD\n");
printf("2.BOOK A ROOM\n3.SHOW MY DETAILS\n4.ABOUT US\
n5.CONTACT US\n6.EXIT\n\n");
printf("Enter your choise = ");
scanf("%d",&decide);
switch(decide)
{
case 1:
food_menu();
case 2:
book_room();
break;
case 3:
show_details();
break;
case 4:
printf("\t\t\t\t**NONE OF THIS\n\n");
case 5:
printf("YOU CAN CONTACT US ON \n\t\t\tE-Mail
[email protected]\n\n\t\t\tCONTACT NO 9553254605\n\n");
printf("\t\t\tWHATSAPP NO 9347515101\n");
case 6:
printf("\n\n\n\t\tVisit again!");
printf("\n\n\t***Thank you for trusting our service.***\n");
break;
default:
printf("Invalid choice. Please try again.\n");
break;
begin();
system("cls");
break;
}
}
void food_menu(void)
{
system("cls");
if(person.food == 0)
{
int ch,qty,i,net=0;
joes:
printf(" =======================");
printf("\n |WELCOME TO SRU C2 HOTEL|\n");
printf(" =======================\n");
printf("\n\t=>MENU CARD");
printf(" \n");
printf("\n\tBREAK FAST");
printf("\n\t\t1.IDLY Rs:40");
printf("\n\t\t2.DOSA Rs:55");
printf("\n\t\t3.VADA Rs:40");
printf("\n\t\t4.PURI Rs:45");
printf("\n\t\t5.CHAPPATHY Rs:40");
printf("\n\tTEA & COFFEE");
printf("\n\t\t6.TEA Rs:10");
printf("\n\t\t7.COFFEE Rs:20");
printf("\n\tSOUPS");
printf("\n\t\t8.Tomato soup Rs:110");
printf("\n\t\t9.Sweetcorn soup Rs:115");
printf("\n\t\t10.Chicken soup Rs:160");
printf("\n\tSTARTER'S");
printf("\n\t\t11.Veg Manchurian Rs:110");
printf("\n\t\t12.Paneer Chilly Rs:125");
printf("\n\t\t13.Chicken Lollypop Rs:180");
printf("\n\t\t14.Chicken Chrispy Rs:185");
printf("\n\tMAIN COURSE");
printf("\n\t\t15.Veg Rice Rs:120");
printf("\n\t\t16.Egg Fried Rice Rs:140");
printf("\n\t\t17.Chicken Biryani Rs:270");
printf("\n\t\t18.Mutton Biryani Rs:330");
printf("\n\t\t19.Fish Fry Rs:210");
printf("\n\tSHAKE'S & COLD DRINK'S");
printf("\n\t\t20.Sprite Rs:25");
printf("\n\t\t21.Thums up Rs:25");
printf("\n\t\t22.MILK SHAKE Rs:70");
printf("\n\n choice your item's : ");
scanf("%d",&ch);
switch(ch)
{
case 1:
printf("\nYou have selected == IDLY");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*40);
break;
case 2:
printf("\nYou have selected == DOSA");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*55);
break;
case 3:
printf("\nYou have selected == VADA");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*40);
break;
case 4:
printf("\nYou have selected == PURI");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*45);
break;
case 5:
printf("\nYou have selected == CHAPPATHY");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*40);
break;
case 6:
printf("\nYou have selected == TEA");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*10);
break;
case 7:
printf("\nYou have selected == COFFEE");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*20);
break;
case 8:
printf("\nYou have selected == TOMATO SOUP");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*110);
break;
case 9:
printf("\nYou have selected == SWEETCORN SOUP");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*115);
break;
case 10:
printf("\nYou have selected == CHICKEN SOUP");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*160);
break;
case 11:
printf("\nYou have selected == VEG MANCGURIAN");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*110);
break;
case 12:
printf("\nYou have selected == PANEER CHILLY");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*125);
break;
case 13:
printf("\nYou have selected == CHICKEN LOLLYPOP");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*180);
break;
case 14:
printf("\nYou have selected == CHICKEN CHRISPY");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*185);
break;
case 15:
printf("\nYou have selected == VEG RICE");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*120);
break;
case 16:
printf("\nYou have selected == EGG FRIED RICE");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*140);
break;
case 17:
printf("\nYou have selected == CHICKEN BIRYANI");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*270);
break;
case 18:
printf("\nYou have selected == MUTTON BIRYANI");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*330);
break;
case 19:
printf("\nYou have selected == FISH FRY");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*210);
break;
case 20:
printf("\nYou have selected == SPRITE");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*25);
break;
case 21:
printf("\nYou have selected == THUMS UP");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*25);
break;
case 22:
printf("\nYou have selected == MILK SHAKE");
printf("\nEnter The Qty : ");
scanf("%d",&qty);
net=net+(qty*70);
break;
default:
printf("\nInvalid Item Selection");
break;
}
printf("\nDo You want to continue press 1: ");
scanf("%d",&i);
if(i==1)
{
goto joes;
}
person.food = net;
printf("\nTotal amount : %d",net);
system("cls");
printf("\tNOTE\n\t * SUCESSFULLY YOUR FOOD DETAILS ARE SAVED\
n\n");
}
}
void book_room(void)
{
if(person.roomno == 0)
{
int type_of_rooms;
char ch,c;int days;
printf(" =======================");
printf("\n |WELCOME TO SRU C2 HOTEL|\n");
printf(" =======================\n\n");
printf("\nWhat type of room do you want to book?\n");
printf("\n1.Basic Room(NON A/C) Rs 1000\n2.Medium room(A/C)
Rs 2000\n3.DELUXE ROOM(A/C) Rs 3000\n4.EXIT\n");
scanf("%d",&type_of_rooms);
fflush(stdin);
if(type_of_rooms==1)
{
printf("\nDo you accept this room?(Press 's' for accept/Press 'n' to exit)\n");
fflush(stdin);
scanf("%c",&c);
if (c=='s')
{
printf("\n =>You choose basic room(NON A/C).\n\n");
printf(" How Many Day's They Want To Stay = ");
scanf("%d",&days);
printf(" your room no is 121\n\n");printf("\n\t\t**** Enjoy your stay
****\n\n");
person.roomno = 121;
person.roomtype = "basic";
person.billprice +=days*1000;
begin();
}
else
begin();
}
if(type_of_rooms==2)
{
printf("\nDo you accept this room?(Press 's' for accept/Press 's' to exit)\
n");
scanf("%c",&c);
if(c=='s')
{
printf("\n =>You choose medium room(A/C).\n\n");
printf(" How Many Day's They Want To Stay = ");
scanf("%d",&days);
printf(" your room no is 212\n\n");printf("\n\t\t**** Enjoy your stay
****\n\n\n");
person.billprice +=days*2000;
person.roomno = 212;
person.roomtype = "medium";
begin();
}
else
begin();
}
if(type_of_rooms==3)
{
printf("\nDo u accept this room?(Press 's' for accept/Press 'n' to exit)\n");
scanf("%c",&c);
if(c=='s')
{
printf("\n =>You choose deluxe room(A/C).\n\n");
printf(" How Many Day's They Want To Stay = ");
scanf("%d",&days);
printf("\n your room no is 312\n\n");printf("\n\t\t**** Enjoy your stay
****\n\n");
person.billprice +=days*3000;
person.roomtype = "deluxe";
person.roomno = 312;
begin();
}
else
begin();
}
if(type_of_rooms==4)
begin();
}
else
printf("you have already booked a room\n\n\n");
}
void show_details(void)
{
system("cls");
time_t timer = time(NULL);
printf("\t NOTE\n\t *YOU CAN GET BILL DETAILS IN (hotel.txt)FILE\
n\n");
FILE *ifp;
ifp = fopen("hotel.txt","w+");
if(ifp == NULL)
{
printf("file cant be opened\n");
}
else
{
fprintf(ifp,"\t\t\t===============\n\t\t\t|SRU C2 HOTEL|\n\t\t\
t===============\n.....BILL DETAILS.....\n...PERSON DETAILS...\n");
fprintf(ifp,"\tName : %s\n",person.name);
fprintf(ifp,"\tNationality : %s\n",person.nationality);
fprintf(ifp,"\tEmail id : %s\n",person.email_id);
fprintf(ifp,"\tAddress : %s\n",person.address);
fprintf(ifp,"\tArrival time : %s\n",ctime(&timer));
fprintf(ifp,"\t\tTOTAL BILL\n\n");
fprintf(ifp,"\tFood Cost : %d/-\n",person.food);
fprintf(ifp,"\tRoom No : %d\n",person.roomno);
fprintf(ifp,"\tRoom Type : %s\n",person.roomtype);
fprintf(ifp,"\tRoom Rent : %d/-\n",person.billprice);
if(strcmp(person.program,"notchosen") != 0)
{
fprintf(ifp,"Program : %s\n",person.program);
}
person.Total=person.billprice+person.food;
fprintf(ifp,"\n\n**press Ctrl+p to print your details(Bill)");
fflush(ifp);
fclose(ifp);
begin();
}
}
SOURCE CODE [HEADER FILE]:
RESULTS: