0% found this document useful (0 votes)
68 views16 pages

Machine Project: CS10-1L Hotel Accommodation and Services System

The document describes a program that allows users to choose a hotel room type, view room details and prices, input the number of nights to calculate expenses, and select a payment method. The program has options for suite, econo, family and studio room types. It calculates total expenses, processes credit card or cash payments, and displays balances. The program was created by two students as a class project and includes source code, built-in functions used, and group contributions.

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)
68 views16 pages

Machine Project: CS10-1L Hotel Accommodation and Services System

The document describes a program that allows users to choose a hotel room type, view room details and prices, input the number of nights to calculate expenses, and select a payment method. The program has options for suite, econo, family and studio room types. It calculates total expenses, processes credit card or cash payments, and displays balances. The program was created by two students as a class project and includes source code, built-in functions used, and group contributions.

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/ 16

MACHINE PROJECT

CS10-1L

Hotel Accommodation
and
Services System

Submitted by:
ALVIENTO, Erick V.
LEONARDO, Darwin Christian G.

A10
MW 12:00-4:30 PM

Submitted to:
Engr. Cheryl Mari M. Isip

3rd Qtr/ 2015-16


TABLE OF CONTENTS

I. Declaration of Originality of Work

II. Machine Project Description


a. Problem Statement
III. Design
a. Source code
b. Output

IV. Built-n functions use


V. References
VI. Group contributions

I. DECLARATION OF ORIGINALITY OF WORK


We hereby declare that this laboratory project entitled, Hotel Accommodation and
Services 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.

________________
NAME & SIGNATURE

________________
NAME & SIGNATURE

II. MACHINE PROJECT DESCRIPTION


a) Problem Statement
Create/Design a program that will let the user to choose the type of room he/she
wants to stay in a hotel. Each room should have brief information, and displaying its price.

Then the user shall input the number of nights he/she will stay to be able to display the
total expenses. The user shall input a number greater than zero as the number of days he/she will
stay which then will be multiplied to the price of the room. If the user will input a number that is
less than or equal to 0, the program will ask the user again.

Then, the user shall input his payment method, which will be credit or cash. If the
payment method is credit, the program shall ask the user’s credit number to be able to show the
remaining balance and the credit balance after paying. Otherwise, if it is cash, the user shall input
the amount he/she will pay and displaying his/her change. Yet, if expenses are greater than cash,
the program will ask the user again.

After completing the process, leave a Thank You message for the users.

III. DESIGN
a) Source Code
#include <iostream>
#include <cmath>
#include <cstdlib>
#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<<" | Leonardo & Alviento | "<<endl;
cout<<" |HOTEL MANAGEMENT SYSTEM| "<<endl;
cout<<" ----------------------- "<<endl;

cout<<" Welcome "<<endl;


cout<<" To Leonardo & Alviento's Hotel Managing System!\n"<<endl;
cout<<"\n"<<endl;

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

do{
menu:
cout<<"Press 1 for Suite Room \n"<<endl;
cout<<"Press 2 for Econo Room \n"<<endl;
cout<<"Press 3 for Family Room \n"<<endl;
cout<<"Press 4 for Studio Room \n"<<endl;
cout<<"Press 5 for Checkout and Exit \n"<<endl;
cout<<"Choose your Desired Room: ";
cin>>selection;
cout<<"\n"<<"\n"<<endl;
}while(selection <! 6);
switch(selection){
case 1:
cout<<"You selected Suite type"<<endl;
cout<<"Here is the brief information about this room. \n"<<endl; //Descriptions
cout<<"Suite type room/Presidential Suite\n"<<endl;
cout<<"Perfect for honeymoons and entertaining clients.\nThis fully air-conditioned
roomfeatures a bedroom with a king sized bed.\nDigital tv, office table and own bath room with
a fashionable bathtub.\nIt also features a dining room, a kitchen area,a living room with a 32-
inch tv, 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 credit card\nPress 2 if cash\nPayment Method: ";
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 we have your credit 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<<"We're sorry but you dont have enough Balance \n"<<endl;
cout<<"Try using different credit card \n"<<endl;
goto cred;
}
formula = fb - expenses;
cout<<"The price you must pay is: "<<expenses<<"\n"<<endl;
cout<<"Your credit 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<<"We have received your cash and it is: "<<cash<<" "<<"Pesos"<<"\n"<<endl;
form = cash - expenses;

if(expenses > cash){


cout<<"Were 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<<"Thankyou! Here's your key and Enjoy your stay! Have a nice day! \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.\nThe 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 credit card\nPress 2 if cash\nPayment Method: ";
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 we have your credit 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<<"We''re sorry but you dont have enough Balance \n"<<endl;
cout<<"Try using different credit card \n"<<endl;
goto crd;
}
formula = fb - expenses;
cout<<"The price you must pay is:"<<expenses<<"Pesos"<<"\n"<<endl;
cout<<"Your credit card Has remaining:"<<fb<<" "<<"Peso"<<"Balance"<<"\n"<<endl;
cout<<"Your credit Balance now is :"<<formula<<" "<<"Pesos"<<"\n "<<endl;
cout<<"\n"<<endl;
cout<<"Thankyou! Here's your key and Enjoy your stay! Have a nice day! \n"<<endl;
}
else{
cout<<"The price you must pay is:"<<expenses<<endl;
cout<<"\n"<<endl;
syz:
cout<<"Enter your cash: ";
cin>>cash;
cout<<"We have received your cash and it is:"<<cash<<"Pesos"<<"\n"<<endl;
form = cash - expenses;

if(expenses > cash){


cout<<"We're' 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<<"Thankyou! Here's your key and Enjoy your stay! Have a nice day! \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!\nGet some free gifts and dental kits to keep the little ones smiling\nTo keep those
smiles bright.\nThe price of Family Type room is: 10000 Pesos \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;
}
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 credit card\nPress 2 if cash\nPayment Method: ";
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 we have your credit 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<<"We're sorry but you dont have enough Balance \n"<<endl;
cout<<"Try using different credit card \n"<<endl;
goto cra;
}
formula = fb - expenses;
cout<<"The price you must pay is:"<<expenses<<"Pesos"<<"\n"<<endl;
cout<<"Your credit 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<<"We have received your cash and it is:"<<cash<<" "<<"Pesos"<<"\n"<<endl;
form = cash - expenses;

if(expenses > cash){


cout<<"We're' 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<<"Thankyou! Here's your key and Enjoy your stay! Have a nice day! \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.\nComposed of Kitchenette,Bars and Room for
musical instruments\nThis room type is Recommended for Parties and Gigs\nThe 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 credit card\nPress 2 if cash\nPayment Method: ";
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 we have your credit 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<<"We're' sorry but you dont have enough Balance \n"<<endl;
cout<<"Try using different credit card \n"<<endl;
goto crap;
}
formula = fb - expenses;
cout<<"The price you must pay is:"<<expenses<<"Pesos"<<"\n"<<endl;
cout<<"Your credit card Has remaining:"<<fb<<" "<<"Peso"<<"Balance"<<"\n"<<endl;
cout<<"Your credit Balance now is :"<<formula<<" "<<"Pesos"<<"\n "<<endl;
cout<<"\n"<<endl;
cout<<"Thankyou! Here's your key and Enjoy your stay! have a nice day! \n"<<endl;
}
else{
cout<<"The price you must pay is:"<<expenses<<"Pesos"<<endl;
cout<<"\n"<<endl;
syns:
cout<<"Enter your cash: ";
cin>>cash;
cout<<"We have received your cash and it is:"<<cash<<"Pesos"<<"\n"<<endl;
form = cash - expenses;

if(expenses > cash){


cout<<"We're' 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<<"Thankyou! Here's your key and Enjoy your stay! Have a nice day! \n"<<endl;

}
break;
case 5:

cout<<"Thank you for visiting Leonardo & Alviento's Hotel Managing System!"<<endl;

return 0;

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

return 0;
}
b) Output

1)
2)

3)
4)

5)
IV. BUILT-IN FUNCTIONS USED
The Built-In Function we used are:
 Data type Integer
 Switch
 Do-while loop
 If and else statements
 Go to function
 Break
 Return
 and Default function.

V. REFERENCES
The references we used for this system are https://isocpp.org/, C++ Programming (Problem
analysis to program design) By: D.S Malik, and en.cppreference.com/.

VI. GROUP CONTRIBUTION

Member Name Task Module Programmed


ALVIENTO, Erick V. Looping,Compilation, ALVIENTO_PROJECT.c
& Formulas pp
LEONARDO, Darwin Christian G. Looping, Compilation, LEONARDO_PROJECT(
formulas, Display of the CPP).cpp
program
Leonardo, Darwin Christian G. Documentation MACHINE-PROJECT
Alviento, Erick V. 2.docx

You might also like