Final Report CSC128
Final Report CSC128
Jasmeen Emira
bt Nasarudin
CSC128
2022613048 Fundamentals of
Computer Problem
Solving
PROJECT REPORT
Mazlan
2022496764
Title
H HOTEL BOOKING WEBSITE
Lecturer
MUHAMAD SAIPUL FAKIR
Siti Noor Syuhada Group
Binti Azhari J4CEEM1102H
2022460034 Submission Date
16/7/2023
CSC128: FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
TOTAL MARKS – 100
1 2 3 4 5
Very Weak Weak Moderate Good Very Good
2. Analysis – Input
3. Analysis – Process
4. Analysis – Output
5. Algorithm Readability
6. Algorithm Efficiency
7. Algorithm Logic
8. Problem Solving
1. System Functionality
The system can solve the
assigned problem and output
should be as per the
specifications.
2. System Accuracy
The system should function
accurately for a long period of time.
Also, function correctly over all
ranges and combinations of data.
4. Implementation of
Programming Structures
- sequential
- selection
- repetition
5. Implementation of
Programming Structures
- function
- array
6. Implementation of
Programming Structures:
- input /output statements
- Process – calculation
8. Quality of Output
- menu
- layout creativity
9. Presentation
- Presentation Skills
- Organization
I (50) + II (50)
Physical booking might have a problem when there’s full of visitors coming at one
time, especially during holidays. This website could help the hotel management be
more systematic. Moreover, it could avoid any wrong calculations or putting data in
the system. Also, hotel reception could manage time more easily for visitors without
any difficulties
2.0 OBJECTIVE
1. INPUT: Fullname
2. INPUT: Contact
3. INPUT: IC
4. INPUT: Nights
5. INPUT: Code
1
6. INPUT: Bed/beds
PROCESS: Fullpay=nights*price
OUTPUT: Bed type
OUTPUT: Payment for room
OUTPUT: Yes or No
9. PROCESS: Total=fullpay+sum
2
4.0 PROGRAM DESIGN
START
READ fullname,
contact, ic, nights
READ code
T
DISPLAY “ROOM :
CASE == ‘S’
STANDARD ROOM”
T
DISPLAY “ROOM :
CASE == ‘P’ PREMIUM ROOM”
READ bed
T
DISPLAY “ROOM :
CASE == ‘V’ VIP ROOM”
DISPLAY “INVALID
CODE. PLEASE TRY
AGAIN.” 3
A
A
DISPLAY “BED : T
Price = 75.00 SINGLE BED” BED == “A1”
F
T
DISPLAY “BED :
Price = 85.00 BED == “B1”
DOUBLE BED”
DISPLAY “INVALID
CODE”
T
DISPLAY “BED :
Price = 100.00 BED == “C2”
DOUBLE BED”
T
DISPLAY “BED : BED == “D2”
Price = 150.00 QUEEN BED”
DISPLAY “INVALID
CODE”
Fullpay =
nights*price
A
4
B
T
B DISPLAY “BED :
Price = 250.00 BEDS == ‘E’ A
QUEEN BED”
T
DISPLAY “BED :
Price = 300.00 BEDS == ‘F’
KING BED”
DISPLAY “INVALID
CODE”
Choose ==
‘y’
READ add
F
T
F
T
Add == ‘D’
fee = 80.00
T
Add == ‘F’ fee = 20.00
T
DISPLAY “Do you wish to
READ choose add more”
Choose == ‘n’
Total = fullpay
DISPLAY fullname,
contact, ic, nights, code,
bed, fullpay, total
END 6
5.0 PROGRAM TESTING
7
8
2. Testing 2 – The program will repeat until user enter the right code
9
10
3. Testing 3 – The program will repeat the add on table if the user enter yes
11
6.0 COMPLETE CODING
#include <iostream>
#include <cstring>
#include <cmath>
int main ()
{ //variable declaration
char fullname[40]="Jasmeen Emira", contact[20]=" ",ic[20]=" ",code,bed[20]=" ";
char beds=' ', choose=' ',answer=' ';
int nights, sum=0, result;
float price,ringgit[6]={75.00,85.00,100.00,150.00,250.00,300.00}, total=00.00, fullpay=00.00;
cout<<"\t------------------------------------------------------------------------"<<endl;
cout<<"\t| CODE | PACKAGE ROOM | BED TYPE(CODE) | PRICE | DESCRIPTION |"<<endl;
cout<<"\t------------------------------------------------------------------------"<<endl;
cout<<"\t| S | STANDARD | SINGLE(A1) | RM 75.00 | FREE HAIR DYER|"<<endl;
cout<<"\t| | | DOUBLE(B1) | RM 85.00 | NO WIFI |"<<endl;
cout<<"\t------------------------------------------------------------------------"<<endl;
cout<<"\t| P | PREMIUM | DOUBLE(C2) | RM 100.00 | FREE HAIR DYER|"<<endl;
cout<<"\t| | | QUEEN (D2) | RM 150.00 | BATHTUB |"<<endl;
cout<<"\t| | | | | FREE WIFI |"<<endl;
cout<<"\t------------------------------------------------------------------------"<<endl;
cout<<"\t| V | VIP | QUEEN(E) | RM 250.00 | PRIVATE FLOOR |"<<endl;
cout<<"\t| | | KING (F) | RM 300.00 | FREE FACILITY |"<<endl;
cout<<"\t| | | | | JACUZZI TUB |"<<endl;
cout<<"\t| | | | | FOODS DELIVERY|"<<endl;
cout<<"\t------------------------------------------------------------------------"<<endl;
cout<<"\t[DISCLAIMER! ENTER RIGHT CODE!]"<<endl;
cout<<"\tDESIRED ROOM(CODE) : ";
cin>>code;
12
total=result;
//reciept
cout<<"\t==============================================================================================
==========="<<endl;
cout<<"\t-----------------------------------------------RECIEPT---------------------------------------
------------"<<endl;
cout<<"\tFULLNAME : SIR/MISS "<<fullname<<endl;
cout<<"\tCONTACT NUMBER : "<<contact<<endl;
cout<<"\tI/C NUMBER : "<<ic<<endl;
cout<<"\tDURATION(nights) : "<<nights<<endl;
cout<<"\tROOM : "<<code<<endl;
cout<<"\tBED TYPE : "<<bed<<endl;
cout<<"\tROOM PRICE : RM "<<fullpay<<endl;
cout<<"\tFULL PAYMENT(include add-on price) : RM "<<total<<endl;
cout<<"\t----------------------------------------------------------------------------------------------
-----------"<<endl;
cout<<"\t==============================================================================================
==========="<<endl;
cout<<"\t-----------------------------------------------RECIEPT----------------------------------------
-----------"<<endl;
cout<<"\tFULLNAME : SIR/MISS "<<fullname<<endl;
cout<<"\tCONTACT NUMBER : "<<contact<<endl;
cout<<"\tI/C NUMBER : "<<ic<<endl;
cout<<"\tDURATION(nights) : "<<nights<<endl;
cout<<"\tROOM : "<<code<<endl;
cout<<"\tBED TYPE : "<<bed<<endl;
cout<<"\tROOM PRICE : RM "<<fullpay<<endl;
cout<<"\tFULL PAYMENT(include add-on price) : RM "<<total<<endl;
cout<<"\t----------------------------------------------------------------------------------------------
-----------"<<endl;
}
else
cout<<"\tINVALID CODE."<<endl;//end nested selection if..else for bed using
string compare for standard room
}
break;//end standard room
{//premium room
case 'P':
case 'p':
cout<<"\tROOM : PREMIUM ROOM"<<endl;
cout<<"\tBED TYPE : ";
cin>>bed;
if (strcmp(bed, "C2")== 0 || strcmp(bed, "c2")== 0)//nested selection if...else for
bed using string compare for premium room
{
cout<<"\tBED : DOUBLE BED"<<endl;
price=ringgit[2];
cout<<"\tROOM PRICE(1 day) : RM "<<price<<endl;
fullpay=price*nights;
cout<<"\tTOTAL PRICE :RM "<<fullpay<<endl;
result=table(fullpay);//return function w parameters (function call)
total=result;
//reciept
cout<<"\t==============================================================================================
==========="<<endl;
cout<<"\t-----------------------------------------------RECIEPT----------------------------------------
-----------"<<endl;
cout<<"\tFULLNAME : SIR/MISS "<<fullname<<endl;
cout<<"\tCONTACT NUMBER : "<<contact<<endl;
cout<<"\tI/C NUMBER : "<<ic<<endl;
13
cout<<"\tDURATION(nights) : "<<nights<<endl;
cout<<"\tROOM : "<<code<<endl;
cout<<"\tBED TYPE : "<<bed<<endl;
cout<<"\tROOM PRICE : RM "<<fullpay<<endl;
cout<<"\tFULL PAYMENT(include add-on price) : RM "<<total<<endl;
cout<<"\t----------------------------------------------------------------------------------------------
-----------"<<endl;
}
else if (strcmp(bed, "D2")== 0 || strcmp(bed, "d2")== 0)
{
cout<<"\tBED : QUEEN ROOM"<<endl;
price=ringgit[3];
cout<<"\tROOM PRICE(1 day) : RM "<<price<<endl;
fullpay=price*nights;
cout<<"\tTOTAL PRICE :RM "<<fullpay<<endl;
result=table(fullpay);//return function w parameters (function call)
total=result;
//reciept
cout<<"\t==============================================================================================
==========="<<endl;
cout<<"\t-----------------------------------------------RECIEPT----------------------------------------
-----------"<<endl;
cout<<"\tFULLNAME : SIR/MISS "<<fullname<<endl;
cout<<"\tCONTACT NUMBER : "<<contact<<endl;
cout<<"\tI/C NUMBER : "<<ic<<endl;
cout<<"\tDURATION(nights) : "<<nights<<endl;
cout<<"\tROOM : "<<code<<endl;
cout<<"\tBED TYPE : "<<bed<<endl;
cout<<"\tROOM PRICE : RM "<<fullpay<<endl;
cout<<"\tFULL PAYMENT(include add-on price) : RM "<<total<<endl;
cout<<"\t----------------------------------------------------------------------------------------------
-----------"<<endl;
}
else
cout<<"\tINVALID CODE."<<endl;//end nested selection if...else for bed using
string compare for premium room
}
break;//end premium room
{//vip room
case 'V':
case 'v':
cout<<"\tROOM : VIP ROOM"<<endl;//nested selection no.3
cout<<"\tBED TYPE :";
cin>>beds;
if (beds == 'E' || beds == 'e') //nested selection if...else for bed using
string compare for vip room
{
cout<<"\tBED : QUEEN BED"<<endl;
price=ringgit[4];
cout<<"\tROOM PRICE(1 day) : RM "<<price<<endl;
fullpay=price*nights;
cout<<"\tTOTAL PRICE :RM "<<fullpay<<endl;
result=table(fullpay);//return function w parameters (function call)
total=result;
//reciept
cout<<"\t==============================================================================================
==========="<<endl;
cout<<"\t-----------------------------------------------RECIEPT----------------------------------------
-----------"<<endl;
cout<<"\tFULLNAME : SIR/MISS "<<fullname<<endl;
cout<<"\tCONTACT NUMBER : "<<contact<<endl;
cout<<"\tI/C NUMBER : "<<ic<<endl;
cout<<"\tDURATION(nights) : "<<nights<<endl;
cout<<"\tROOM : "<<code<<endl;
cout<<"\tBED TYPE : "<<beds<<endl;
cout<<"\tROOM PRICE : RM "<<fullpay<<endl;
cout<<"\tFULL PAYMENT(include add-on price) : RM "<<total<<endl;
cout<<"\t----------------------------------------------------------------------------------------------
-----------"<<endl;
14
}
else if (beds == 'F' || beds == 'f')
{
cout<<"\tBED : KING BED"<<endl;
price=ringgit[5];
cout<<"\tROOM PRICE(1 day) : RM "<<price<<endl;
fullpay=price*nights;//kira1
cout<<"\tTOTAL PRICE :RM "<<fullpay<<endl;
result=table(fullpay);//return function w parameters (function call)
total=result;
//reciept
cout<<"\t==============================================================================================
==========="<<endl;
cout<<"\t-----------------------------------------------RECIEPT----------------------------------------
-----------"<<endl;
cout<<"\tFULLNAME : SIR/MISS "<<fullname<<endl;
cout<<"\tCONTACT NUMBER : "<<contact<<endl;
cout<<"\tI/C NUMBER : "<<ic<<endl;
cout<<"\tDURATION(nights) : "<<nights<<endl;
cout<<"\tROOM : "<<code<<endl;
cout<<"\tBED TYPE : "<<beds<<endl;
cout<<"\tROOM PRICE : RM "<<fullpay<<endl;
cout<<"\tFULL PAYMENT(include add-on price) : RM "<<total<<endl;
cout<<"\t------------------------------------------------------------------------------
---------------------------"<<endl;
}
else
cout<<"\tINVALID CODE."<<endl;//end nested selection if...else for bed using
string compare for vip room
}
break;//end vip room
default:
cout<<"\tINVALID CODE. PLEASE TRY AGAIN."<<endl;
}//end switch...case for room
return 0;
}
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\t| CODE | ADD-ON | PRICE | DESCRIPTION | DESCRIPTION |"<<endl;
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\t| B | BREAKFAST | 30.00 | NASI LEMAK | |"<<endl;
cout<<"\t| | | | CEREAL | |"<<endl;
cout<<"\t| | | | COFFEE | |"<<endl;
cout<<"\t| | | | TOAST | PER FAMILY |"<<endl;
cout<<"\t| | | | FRIED RICE | |"<<endl;
cout<<"\t| | | | TEA | |"<<endl;
cout<<"\t| | | | MILK | |"<<endl;
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\t| L | LUNCH | 70.00 | NASI MINYAK | |"<<endl;
cout<<"\t| | | | NASI TOMATO | |"<<endl;
cout<<"\t| | | | NASI ARAB | |"<<endl;
cout<<"\t| | | | NASI KERABU | PER FAMILY |"<<endl;
cout<<"\t| | | | ORANGE JUICE| |"<<endl;
cout<<"\t| | | | SYRUP | |"<<endl;
cout<<"\t| | | | HOT MILK TEA| |"<<endl;
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\t| D | DINNER | 80.00 | SPAGHETTI | |"<<endl;
cout<<"\t| | | | WESTERN FOOD| |"<<endl;
cout<<"\t| | | | SATAY | PER FAMILY |"<<endl;
15
cout<<"\t| | | | PORRIDGE | |"<<endl;
cout<<"\t| | | | ANY WATER | |"<<endl;
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\t| F | FACILITY | 20.00 | GYM | |"<<endl;
cout<<"\t| | | | POOL | NON VIP |"<<endl;
cout<<"\t| | | | SPA | |"<<endl;
cout<<"\t| | | | FOOD DELIVERY| |"<<endl;
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\tDo you want to add-on anything from our package?"<<endl;
cout<<"\tEnter Y as YES and ANY ALPHABET as NO : ";
cin>>choose;
do
{//loop do while
if (choose=='Y'|| choose=='y')//selection for add-on
{
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\t| CODE | ADD-ON | PRICE | DESCRIPTION | DESCRIPTION |"<<endl;
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\t| B | BREAKFAST | 30.00 | NASI LEMAK | |"<<endl;
cout<<"\t| | | | CEREAL | |"<<endl;
cout<<"\t| | | | COFFEE | |"<<endl;
cout<<"\t| | | | TOAST | PER FAMILY |"<<endl;
cout<<"\t| | | | FRIED RICE | |"<<endl;
cout<<"\t| | | | TEA | |"<<endl;
cout<<"\t| | | | MILK | |"<<endl;
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\t| L | LUNCH | 70.00 | NASI MINYAK | |"<<endl;
cout<<"\t| | | | NASI TOMATO | |"<<endl;
cout<<"\t| | | | NASI ARAB | |"<<endl;
cout<<"\t| | | | NASI KERABU | PER FAMILY |"<<endl;
cout<<"\t| | | | ORANGE JUICE| |"<<endl;
cout<<"\t| | | | SYRUP | |"<<endl;
cout<<"\t| | | | HOT MILK TEA| |"<<endl;
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\t| D | DINNER | 80.00 | SPAGHETTI | |"<<endl;
cout<<"\t| | | | WESTERN FOOD| |"<<endl;
cout<<"\t| | | | SATAY | PER FAMILY |"<<endl;
cout<<"\t| | | | PORRIDGE | |"<<endl;
cout<<"\t| | | | ANY WATER | |"<<endl;
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\t| F | FACILITY | 20.00 | GYM | |"<<endl;
cout<<"\t| | | | POOL | NON VIP |"<<endl;
cout<<"\t| | | | SPA | |"<<endl;
cout<<"\t| | | | FOOD DELIVERY| |"<<endl;
cout<<"\t--------------------------------------------------------------------"<<endl;
cout<<"\tADD-ON(CODE) : ";
cin>>add;
{
if (add == 'B' || add == 'b')//start nested selection if
{
cout<<"\tADD-ON : BREAKFAST"<<endl;
fee=rm[0];
cout<<"\tPRICE : RM "<<fee<<endl;
cout<<"\tDo you wish to add more?"<<endl;
cout<<"\tY as YES and ANY ALPHABET as NO : ";
cin>>choose;
sum+=fee;
cout<<"\tADD-ON PRICE : RM "<<sum<<endl;//price for add-on
}
else if (add == 'L' || add == 'l')
{
cout<<"\tADD-ON : LUNCH"<<endl;
fee=rm[1];
cout<<"\tPRICE : RM "<<fee<<endl;
cout<<"\tDo you wish to add more?"<<endl;
cout<<"\tY as YES and ANY ALPHABET as NO : ";
cin>>choose;
sum+=fee;
cout<<"\tADD-ON PRICE : RM "<<sum<<endl;//price for add-on
}
else if (add == 'D' || add == 'd')
{
cout<<"\tADD-ON : DINNER"<<endl;
fee=rm[2];
cout<<"\tPRICE : RM "<<fee<<endl;
cout<<"\tDo you wish to add more?"<<endl;
cout<<"\tY as YES and ANY ALPHABET as NO : ";
16
cin>>choose;
sum+=fee;
cout<<"\tADD-ON PRICE : RM "<<sum<<endl;//price for add-on
}
else if (add == 'F' || add == 'f')
{
cout<<"\tADD-ON : FACILITY"<<endl;
fee=rm[3];
cout<<"\tPRICE : RM "<<fee<<endl;
cout<<"\tDo you wish to add more?"<<endl;
cout<<"\tY as YES and ANY ALPHABET as NO : ";
cin>>choose;
sum+=fee;
cout<<"\tADD-ON PRICE : RM "<<sum<<endl;//price for add-on
}
else
cout<<"\tINVALID CODE.TRY AGAIN."<<endl;
} //end nested selection if
}
else
cout<<"\tPRICE : RM 0"<<endl;
}
while (choose== 'Y' || choose=='y');//end loop do while
17