0% found this document useful (0 votes)
55 views18 pages

Machine Project Documentation CS10-1L: Hotel Accommodation System

The document is a project documentation for a hotel accommodation system created by three students. It includes an introduction, problem statement, design section with an algorithm flowchart and source code, and a conclusion declaring the original work. The source code allows a user to select a hotel room type, view the description and price, input the number of nights, choose a payment method (credit or cash), and process the payment.

Uploaded by

Rick Alviento
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views18 pages

Machine Project Documentation CS10-1L: Hotel Accommodation System

The document is a project documentation for a hotel accommodation system created by three students. It includes an introduction, problem statement, design section with an algorithm flowchart and source code, and a conclusion declaring the original work. The source code allows a user to select a hotel room type, view the description and price, input the number of nights, choose a payment method (credit or cash), and process the payment.

Uploaded by

Rick Alviento
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Machine Project Documentation

CS10-1L

Hotel Accommodation System

Submitted by:
Sy, Royce John I.
Directo, Giovani O.
Pascua, Arvin Joseph S.

Section and Lab. Schedule:


A2/MW: 12:00-4:30 PM

Submitted to:
Engr. Cheryl Mari M. Isip

3rd Q/2014-2015
Declaration of Originality of Work

We hereby declare that this laboratory project entitled HOTEL


ACCOMMODATION SYSTEM submitted as partial fulfilment of the
requirements for the course CS10-1L, is our own unaided work and
not copied from nor written in any collaboration with other person or
institution, and has not been formerly submitted to other university/
institution as program requirement.

ARVIN JOSEPH S. PASCUA ROYCE JOHN I. SY


Name and Signature Name and Signature

GIOVANI O. DIRECTO
Name and Signature
Machine Project Description:
This program allows the user to choose the type of room he/she wants to stay in a hotel.
After choosing, the program will show the description of the chosen room and the
price/day. The user will then input the number of days he/she will stay; this will be
multiplied to the price for the user to know the total cost. It will then let the user pick the
type of payment he/she wants to make, either credit or cash. If credit, the user has to
input his/her credit card number and the program will then show the balance of the
credit card and the balance after reducing it with the payment. If the user chose to pay
in cash, it will then make the user input the amount he/she will pay and the change
he/she will receive.

Problem Statement:
Write a program that lets the user choose the type of room in a hotel. After choosing, it
will output the description of the room and the price/day. The user will then input a
number greater than zero as the number of days he will stay which will be multiplied to
the price of the room. If the user input a number less than or equal to 0 then the
program will loop to the first question and ask the user again.

After the user inputs the correct value, the program will ask the user the method of
payment, either credit or cash. If credit, the program will ask for the credit card number
and it will show the initial balance and the final balance, in which the Final Balance =
Initial Balance – (price*no of days he will stay). If cash, it will then make the user input
the amount he/she will pay and the change he/she will receive but if the payment is less
than the amount to pay the program will loop and ask the user to input another amount.
Design
a. Algorithm – Before our group created the program, we listed the things that we
must consider in making this program, we conducted a research about the Room
types, how do they pay and we also considered the mode of payment the user
will use. In terms of formula formulation what we did was we just subtracted the
number of stay to the user’s current cash or credit cards balance.
Here is the flowchart of our program for the viewer’s better understanding:

Start/
Start/Menu
Menu

Desired Room

Input

Selection < 6

F
Selection==1 Room Info No. of Stay No. of Stay Error!
!=0

Payment Method
Selection==2

Input

Note: Continuation next page!


F Error!
Selection==3 Input <=2
Insufficient
Money

T T

Selection==4 T
Input ==1 Enter card no. Input Formula Price Price>Card

Error!
F F
F
T Balance
Selection==5 T
Input ==2 Enter Cash Input Formula Cash>Exp

T Formula
Cash
Start/ Remaining
Stop
Menu
Total Cash

Start/
Stop
Menu
Exit
b. Source Code

#include <cstdlib>
#include <iostream>
#include <cmath>
#include <time.h>
using namespace std;
int main()
{
int selection;
int form;
int a;
int b;
int stay;
int expenses;
int choice;
int cash;
int formula;

cout<<" ****************** "<<endl;


cout<<" * Sempiternal * "<<endl;
cout<<" ****************** "<<endl;
cout<<"\n"<<endl;

cout<<" Welcome To Sempiternal Hotel"<<endl;


cout<<" Where myth fades to Legend\n"<<endl;
cout<<"\n"<<endl;

cout<<"Here's the list of Available rooms: \n"<<endl;

do{
menu:
cout<<"Press 1 for Suite Type Room \n"<<endl;
cout<<"Press 2 for Econo Type Room \n"<<endl;
cout<<"Press 3 for Family Type Room \n"<<endl;
cout<<"Press 4 for Studio Type Room \n"<<endl;
cout<<"Press 5 for Checkout and exit \n"<<endl;
cout<<"Choose your Desired Room Type: ";
cin>>selection;
cout<<"\n"<<"\n"<<endl;

}while(selection <! 6);


switch(selection){
case 1:
cout<<"You selected Suite type \n"<<endl;
cout<<"Here is the brief information about this room. \n"<<endl; //Descriptions
cout<<"\n"<<endl;
cout<<"Suite type room/Presidential Suite\n"<<endl;
cout<<"Perfect for honeymoons and entertaining clients. \n"<<endl;
cout<<"This fully air-conditioned room features a bedroom with a king sized
bed"<<"\n"<<"\n"<<"Digital tv, office table and own bathroom with a fashionable
bathtub.\n"<<endl;
cout<<"It also features a dining room, a kitchen area\n"<<"\n"<<"A living room
with a 32-inch tv \n"<<"\n"<<"A balcony with the perfect view of the city
lights.\n"<<endl;

cout<<"The price of suite room is: 18000 Pesos\n"<<endl;


repeat:
cout<<"How many nights would you like to stay?: ";
cin>>stay;
cout<<"\n"<<endl;
if(stay <= 0){
cout<<"Error Number of Stay, Must be Atleast 1 Day! \n"<<endl;
goto repeat;
}
if(stay>=1)
expenses = 18000 * stay;
cout<<"The total expenses will be: "<<expenses<<"Pesos"<<"\n"<<endl;
esc:
cout<<"Choose Payment Method \n"<<endl;
cout<<"Press 1 if debit card:\nPress 2 if cash: ";
cin>>choice;
int fb;

if(choice <= 0){


cout<<"Error Payment method, must be 1 or 2 only \n"<<endl;
goto esc;
cout<<"\n"<<endl;
} else
if(choice >=3){
cout<<"Error Payment method, must be 1 or 2 only \n"<<endl;
goto esc;
cout<<"\n"<<endl;
}

if (choice == 1){
cout<<"May i have your Debit card so we can process your Transaction
\n"<<endl;
cred:
cout<<"Enter Card Number: "; // name and balance of card
cin>>a;
cout<<"\n"<<endl;

srand (time(NULL));
b = (rand()*1)*a;
fb = b;
cout<<"Credit card holder Code is:PM-13-0957"<<a<<"\n"<<endl;
if(expenses > fb){
cout<<"Im sorry but you dont have enough Balance \n"<<endl;
cout<<"Try using different debit card \n"<<endl;
goto cred;
}
formula = fb - expenses;
cout<<"The price you must pay is: "<<expenses<<"\n"<<endl;
cout<<"Your debit card Has remaining: "<<fb<<"
"<<"Peso"<<"Balance"<<"\n"<<endl;
cout<<"Your credit Balance now is : "<<formula<<" "<<"Pesos"<<"\n "<<endl;
cout<<"\n"<<endl;
cout<<"Congratulations! Here's your key and Enjoy your stay! \n"<<endl;
}
else{
cout<<"The price you must pay is:"<<expenses<<"Pesos"<<endl;
cout<<"\n"<<endl;
sys:
cout<<"Enter your cash: ";
cin>>cash;
cout<<"I have received your cash and it is: "<<cash<<" "<<"Pesos"<<"\n"<<endl;
form = cash - expenses;

if(expenses > cash){


cout<<"Im sorry but you dont have enough money to avail this room type
\n"<<endl;
cout<<"Try Again \n"<<endl;
goto sys;
}
cout<<"Your Change is :"<<form<<" "<<"Pesos"<<"\n "<<endl;
cout<<"\n"<<endl;
cout<<"Congratulations! Here's your key and Enjoy your stay! \n"<<endl;
}

break;
case 2:
cout<<"You selected Econo Type \n"<<endl;
cout<<"Here is the brief information about this room. \n"<<endl;
cout<<"The Econo room, is a well-appointed room perfect for a single
guest."<<"\n"<<"The bedroom is very comfortable and includes bed concept \n
"<<endl;
cout<<"The room is air conditioned, and has a flat LCD TV \nThe bathroom is
equipped with shower facilities.\nThe size of the room is 16sqm."<<endl;

cout<<"The price of Econo Type room is: 800 Pesos\n"<<endl;


rep:
cout<<"How many nights would you like to stay?: ";
cin>>stay;
cout<<"\n"<<endl;
if(stay <= 0){
cout<<"Error Number of Stay, Must be Atleast 1 Day! \n"<<endl;
goto rep;
}
if(stay>=1)
expenses = 800 * stay;
cout<<"The total expenses will be:"<<" "<<expenses<<" "<<"Pesos"<<"\n"<<endl;
ec:
cout<<"Choose Payment Method \n"<<endl;
cout<<"Press 1 if debit card:\nPress 2 if cash: ";
cin>>choice;

if(choice <= 0){


cout<<"Error Payment method, must be 1 or 2 only \n"<<endl;
goto esc;
} else
if(choice >=3){
cout<<"Error Payment method, must be 1 or 2 only \n"<<endl;
goto ec;
cout<<"\n"<<endl;
}

if (choice == 1){
cout<<"May i have your Debit card so we can process your Transaction
\n"<<endl;
crd:
cout<<"Enter Card Number: "; // Card desc.
cin>>a;
cout<<"\n"<<endl;

srand (time(NULL));
b = (rand()*1)*a;
fb = b;
cout<<"Credit card holder Code is:PM-13-0957"<<a<<"\n"<<endl;
if(expenses > fb){
cout<<"Im sorry but you dont have enough Balance \n"<<endl;
cout<<"Try using different debit card \n"<<endl;
goto crd;
}
formula = fb - expenses;
cout<<"The price you must pay is:"<<expenses<<"Pesos"<<"\n"<<endl;
cout<<"Your debit card Has remaining:"<<fb<<"
"<<"Peso"<<"Balance"<<"\n"<<endl;
cout<<"Your credit Balance now is :"<<formula<<" "<<"Pesos"<<"\n "<<endl;
cout<<"\n"<<endl;
cout<<"Congratulations! Here's your key and Enjoy your stay! \n"<<endl;
}
else{
cout<<"The price you must pay is:"<<expenses<<endl;
cout<<"\n"<<endl;
syz:
cout<<"Enter your cash: ";
cin>>cash;
cout<<"I have received your cash and it is:"<<cash<<"Pesos"<<"\n"<<endl;
form = cash - expenses;

if(expenses > cash){


cout<<"Im sorry but you dont have enough money to avail this room type
\n"<<endl;
cout<<"Try Again \n"<<endl;
goto syz;
}
cout<<"Your Change is :"<<form<<" "<<"Pesos"<<"\n "<<endl;
cout<<"\n"<<endl;
cout<<"Congratulations! Here's your key and Enjoy your stay! \n"<<endl;

}
break;
//case 3
case 3:
cout<<"You selected Family Type \n"<<endl;
cout<<"Here is the brief information about this room. \n"<<endl;
cout<<"A room built just for families, now there's a novel concept. \n"<<endl;
cout<<"The family room comes with bunk beds for the kiddies\nWith even has
cute themed bedding!"<<"\n"<<"Get some free gifts and dental kits to keep the little
ones smiling\nTo keep those smiles bright.\n"<<endl;
cout<<"The price of Family Type room is: 10000 Pesos \n"<<endl;
rp:cout<<"\n"<<endl;
cout<<"How many nights would you like to stay?: ";
cin>>stay;
cout<<"\n"<<endl;
if(stay <= 0){
cout<<"Error Number of Stay, Must be Atleast 1 Day! \n"<<endl;
goto rp;
}
if(stay>=1)
expenses = 10000 * stay;
cout<<"The total expenses will be:"<<" "<<expenses<<" "<<"Pesos"<<"\n"<<endl;
ecv:
cout<<"Choose Payment Method \n"<<endl;
cout<<"Press 1 if debit card:\nPress 2 if cash: ";
cin>>choice;

if(choice <= 0){


cout<<"Error Payment method, must be 1 or 2 only \n"<<endl;
goto ecv;
} else
if(choice >=3){
cout<<"Error Payment method, must be 1 or 2 only \n"<<endl;
goto ecv;
cout<<"\n"<<endl;
}

if (choice == 1){
cout<<"May i have your Debit card so we can process your Transaction
\n"<<endl;
cra:
cout<<"Enter Card Number: "; // name and balance of card
cin>>a;
cout<<"\n"<<endl;

srand (time(NULL));
b = (rand()*1)*a;
fb = b;
cout<<"Credit card holder Code is:PM-13-0957"<<a<<"\n"<<endl;
if(expenses > fb){
cout<<"Im sorry but you dont have enough Balance \n"<<endl;
cout<<"Try using different debit card \n"<<endl;
goto cra;
}
formula = fb - expenses;
cout<<"The price you must pay is:"<<expenses<<"Pesos"<<"\n"<<endl;
cout<<"Your debit card Has remaining:"<<fb<<"
"<<"Peso"<<"Balance"<<"\n"<<endl;
cout<<"Your credit Balance now is :"<<formula<<" "<<"Pesos"<<"\n "<<endl;
cout<<"\n"<<endl;
cout<<"Congratulations! Here's your key and Enjoy your stay! \n"<<endl;
}
else{
cout<<"The price you must pay is:"<<expenses<<"Pesos"<<endl;
cout<<"\n"<<endl;
syn:
cout<<"Enter your cash: ";
cin>>cash;
cout<<"I have received your cash and it is:"<<cash<<" "<<"Pesos"<<"\n"<<endl;
form = cash - expenses;

if(expenses > cash){


cout<<"Im sorry but you dont have enough money to avail this room type
\n"<<endl;
cout<<"Try Again \n"<<endl;
goto syn;
}
cout<<"Your Change is :"<<form<<" "<<"Pesos"<<"\n "<<endl;
cout<<"\n"<<endl;
cout<<"Congratulations! Here's your key and Enjoy your stay! \n"<<endl;
}
break;
case 4:
cout<<"You selected Studio type\n"<<endl;
cout<<"Here is the brief information about this room. \n"<<endl;
cout<<"Large room which satisfy your taste."<<"\n"<<"Composed of
Kitchenette,Bars and Room for musical instruments"<<endl;
cout<<"This room type is Recommended for Parties and Gigs\n"<<endl;
cout<<"The price of Studio Type room is: 15000 Pesos \n"<<endl;
rpg:
cout<<"How many nights would you like to stay?: ";
cin>>stay;
cout<<"\n"<<endl;
if(stay <= 0){
cout<<"Error Number of Stay, Must be Atleast 1 Day! \n"<<endl;
goto rpg;
}
if(stay>=1)
expenses = 15000 * stay;
cout<<"The total expenses will be:"<<" "<<expenses<<"Pesos"<<"\n"<<endl;
ecva:
cout<<"Choose Payment Method \n"<<endl;
cout<<"Press 1 if debit card:\nPress 2 if cash: ";
cin>>choice;
if(choice <= 0){
cout<<"Error Payment method, must be 1 or 2 only \n"<<endl;
goto ecva;
} else
if(choice >=3){
cout<<"Error Payment method, must be 1 or 2 only \n"<<endl;
goto ecva;
cout<<"\n"<<endl;
}

if (choice == 1){
cout<<"May i have your Debit card so we can process your Transaction
\n"<<endl;
crap:
cout<<"Enter Card Number: "; // name and balance of card
cin>>a;
cout<<"\n"<<endl;

srand (time(NULL));
b = (rand()*1)*a;
fb = b;
cout<<"Credit card holder Code is:PM-13-0957"<<a<<"\n"<<endl;
if(expenses > fb){
cout<<"Im sorry but you dont have enough Balance \n"<<endl;
cout<<"Try using different debit card \n"<<endl;
goto crap;
}
formula = fb - expenses;
cout<<"The price you must pay is:"<<expenses<<"Pesos"<<"\n"<<endl;
cout<<"Your debit card Has remaining:"<<fb<<"
"<<"Peso"<<"Balance"<<"\n"<<endl;
cout<<"Your credit Balance now is :"<<formula<<" "<<"Pesos"<<"\n "<<endl;
cout<<"\n"<<endl;
cout<<"Congratulations! Here's your key and Enjoy your stay! \n"<<endl;
}
else{
cout<<"The price you must pay is:"<<expenses<<"Pesos"<<endl;
cout<<"\n"<<endl;
syns:
cout<<"Enter your cash: ";
cin>>cash;
cout<<"I have received your cash and it is:"<<cash<<"Pesos"<<"\n"<<endl;
form = cash - expenses;

if(expenses > cash){


cout<<"Im sorry but you dont have enough money to avail this room type
\n"<<endl;
cout<<"Try Again \n"<<endl;
goto syns;
}
cout<<"Your Change is :"<<form<<" "<<"Pesos"<<"\n "<<endl;
cout<<"\n"<<endl;
cout<<"Congratulations! Here's your key and Enjoy your stay! \n"<<endl;

}
break;

case 5:

cout<<"Thank you for visiting Sempiternal Hotel"<<endl;

return EXIT_SUCCESS;

default:{
cout<<"Error Choice, It must be from 1-4 only \n"<<endl;
cout<<"Have a nice day!"<<endl;
goto menu;
cout<<"\n"<<endl;
}
}
system("PAUSE");

return EXIT_SUCCESS;
}

c. Output – five sets of output, with different inputs


Built-in Functions Used:
Here is the list of built in functions we used:
 Data type Integer
 Switch
 Do-while loop
 If and else statements
 Go to function
 Break
 Return
 and Default function.

References:
The references we used in making this program are C++ Programming (Problem
analysis to program design) By: D.S Malik and the other book we used as our basis for
syntaxes is Programming in C (3rd Edition) By: Stephen G. Kochan
Group Contributions:

Member Name Task Module Programmed

Display of the
Sy, Royce John I. SY_PROJECT.cpp
Program

Looping and
Sy, Royce John I. SY_PROJECT.cpp
Compilation

Display of the
Pascua, Arvin Joseph S. PASCUA_PROJECT.cpp
Program

Looping and PASCUA and


Pascua, Arvin Joseph S.
Compilation SY_PROJECT.cpp

Display of the
Directo, Giovani O. DIRECTO_PROJECT.cpp
Program

Looping and DIRECTO,PASCUA and


Directo, Giovani O.
Compilation SY_PROJECT.cpp

Directo, Giovani O. Formulas DIRECTO_PROJECT.cpp

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy