NAME: AHMAD TIJJANI ABDULLAHI
REG NUM: CST/18/SWE/00175
ASSIGNMENT: SOFTWARE CONSTRUCTION
HOTEL MANAGEMENT SYSTEM
PSEUDOCODE
begin
class HotelSystem{
private access (admin access class):
FUCTION
Declarations
int room_no;
char name[30];
char address[50];
char phone[15];
long days;
long cost;
long payment;
void breakfast(int);
void lunch(int);
void dinner(int);
public access (customer access class):
FUCTION
Declarations
void main_menu(); //to dispay the main menu
void add(); //to book a room
void display(); //to display the customerinformation
void rooms(); //to display alloted rooms
void edit(); //to edit the customer by calling delete
int check(int); //to check room status
void modify(); //to modify the customer information
void delete_rec(); //to check out the customer
void restaurant(); //to order food from restaurant
void modify_name(int); //to modify name of guest
void modify_address(int); //to modify address of guest
void modify_phone(int); //to modify phone number of guest
void modify_days(int); //to
Function void Hotel main_menu()
Declarations
int choice
WHILE(choice !=6)
begin
display”**THE HOTEL**";
display"* MAIN MENU *";
display"1. Book A Room";
display"2. Customer Information";
display” Rooms Allotted";
display"4. Edit Customer Details";
display"5. Order Food from Restaurant";
display"6. Exit";
display"Enter Your Choice: ";
accept choice
switch(choice)
begin
case 1: add();
case 2: display();
case 3: rooms();
case 4: edit();
case 5: restaurant();
case 6: return;
default: display “wrong choice.“
display “press any key to continue.“
ENDIF
END
FUNCTION void Hotel add():
Declaration
int room,flag;
display "| Rooms | Room Type |";
display "| 1-50 | Deluxe |";
display "| 51-80 | Executive |";
display "| 81-100 | Presidential |";
display "ENTER CUSTOMER DETAILS";
display "Room Number: ";
accept room;
flag=check(room);
IF(flag==1)
display "Sorry, Room is already booked.";
ELSE
IF (flag==2)
display " Sorry, Room does not exist.";
ELSE
room_no=room;
display " Name: ";
accept name;
display "Address: ";
accept address;
display " Phone Number: ";
accept phone;
display " Number of Days: ";
accept days;
ENDIF
if(room_no>=1 and room_no<=50)
strcpy(rtype,"Deluxe");
cost=days*10000;
else
if(room_no>=51&&room_no<=80)
{
strcpy(rtype,"Executive");
cost=days*12500;
}
else
{
if(room_no>=81&&room_no<=100)
{
strcpy(rtype,"Presidential");
cost=days*15000;
}
}
}