Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Make full diagram flowchart using this programming. #include #include #include using namespace std; //GLOBAL DECLARATION void totalprice (int& r, double y, int&days); //DINI void displaytotalprice
Make full diagram flowchart using this programming.
#include
#include
#include
using namespace std;
//GLOBAL DECLARATION
void totalprice (int& r, double y, int&days); //DINI
void displaytotalprice (double& z); //DINI
int days, k, e; //DINI
double totalPrice, price; //DINI
string p_a="2 Queen bed"; //DINI
string p_b="2 King bed"; //DINI
string p_c="1 King bed & 1 Queen bed"; //DINI
string q_a="Queen bed"; //DINI
string q_b="King bed"; //DINI
double price_buff=0,sum_price=0;
double all_bills=0, sum_bill=0; //FAZ
int main()
{
//local declaration
char name[100], email[20],phone_number[20], ic_number[20] ; //Qif
int number_of_guest; //Qif
cout<< " Enter your name : ";
cin>>name;
cout<< " Enter your email : ";
cin>>email;
cout<< " Enter your phone number : ";
cin>>phone_number;
cout<< " Enter your ic number : ";
cin>>ic_number;
cout<< " Enter number of guest : ";
cin>>number_of_guest;
cout<
cout<< " Your name is "<< name << endl;
cout<< " Your email is "<< email << endl;
cout<< " Your phone number is "<< phone_number << endl;
cout<< " Your ic number is "<< ic_number << endl;
cout<< " number of guest is "<< number_of_guest << endl;
double price=0; //DINI
int r, days; //DINI
cout << " How long do you want to stay at this hotel? >> ";
cin >> days;
cout << " What type of room do you prefer ? " << endl;
cout << " 1. Single (S) : RM 200/night " << endl;
cout << " 2. Deluxe (D) : RM 400/night " << endl;
cout << " 3. Premium(P) : RM 600/night " << endl;
cout << " Please select your room type (1/2/3) >> ";
cin >> r;
totalprice(r, price, days); //KIV
displaytotalprice (totalPrice);
char meals, ansMeal, food; //FAZ
int i, loop=0; //FAZ
cout << " Do you want your hotel reservation including meals? " << endl;
cout << "Yes (Y) or No (N) : ";
cin >> ansMeal;
while (ansMeal!='Y'&& ansMeal!='y'&& ansMeal!='N'&& ansMeal!='n') //x tau knpa???? KIV
{
cout<<" Invalid input ";
cout << " Do you want your hotel reservation including meals? " << endl;
cout << " Yes (Y) or No (N) ";
cin >> ansMeal;
}
if (ansMeal=='Y'||ansMeal=='y')
{
for (i=0;i=loop||meals!='S';i++)
{
char Skip1,Skip2,Skip3;
cout << " What meals code do you want?";
cout <<" Code B - Breakfast Code L - Lunch Code D - Dinner ";
cout <
cout << " Enter the code (Enter 'S' for stop) >> ";
cin>>meals;
if ( Skip1!='a'&& meals=='B')
{ cout << " Buffet Breakfast ";
price_buff=30;
cout << " RM 30 for Buffet Breakfast ";
sum_price+=price_buff;
cout << "Please choose if you want another meals ";
Skip1='a';
}
else if ( Skip2!='b'&&meals=='L')
{ cout << " Buffet Lunch ";
price_buff=50;
cout << " RM 50 for Buffet Lunch ";
sum_price+=price_buff;
cout << "Please choose if you want another meals ";
Skip2='b';
}
else if ( Skip3!='c'&&meals=='D')
{ cout << "Buffet Dinner ";
price_buff=70;
cout << " RM 70 for Buffet Dinner ";
sum_price+=price_buff;
cout << "Please choose if you want another meals ";
Skip3='c';
}
else if ( meals=='S')
break;
else // For wrong code
{ cout << " INVALID INPUT! Try Again! "; //KIV
continue;
}
}
cout<<"Your total price for meals Buffet is RM " <
}
else
{ cout<< "You are not reserved the meals."<
}
double bill_service=0; //SEY
char service; //SEY
cout<< "SERVICE PACKAGE" << endl;
cout << " 1. Assistance with luggage " << endl;
cout << " 2. Buffet Assistance (to Door)) " << endl;
cout << " 3. PWake-up call service " << endl;
cout << " 3. transportation (Helicopter, Mini Ship, SUV Car) " << endl;
cout<<"Do you want to suscribe SERVICE PACKAGE? Enter 'Y' for YES | 'N' FOR NO >>";
cin>>service;
while (service!='Y'&& service!='y'&& service!='N'&& service!='n')
{
cout<< "Invalid Input!"<
cout<<" Do you want to suscribe SERVICE PACKAGE? Enter 'Y' for YES | 'N' FOR NO >> ";
cin>>service;
}
if (service=='Y'||service=='y')
{ bill_service=200;
cout << "You will be charged RM200. "<
}
else
cout << "You are not being charged to SERVICE PACKAGE. " <
int g, choice, faci;
cout << "Popular facalities ";
cout << "1. Spa" << endl;
cout << "2. Gym" << endl;
cout << "3. Mimi Cinema" << endl;
cout << "4. Swimming Pool" << endl;
int j, count=1;
char faci_use;
for (j=0;j=count;j++) //KIV
{ cout<< " Do you want to use the facility/facilities? ";
cout <<" Enter Y for YES, N for NO >> ";
cin>>faci_use;
if(faci_use=='Y'||faci_use=='N'||faci_use=='y'||faci_use=='n')
break;
cout << " Wrong INPUT ";
count++;
continue;
}
if(faci_use=='Y'||faci_use=='y')
{
cout << " How many facilities you want to use? >> ";
cin >> faci;
while (faci<=0 || faci>4)
{
cout <<" Invalid input! Please Try Again!";
cout << " How many facilities you want to use?";
cin >> faci;
}
double bill=0;
char Jump1, Jump2, Jump3, Jump4;
for (g=0;g
{
cout << " Enter your choices >> ";
cin >> choice;
if (choice==1&&Jump1!='A')
{bill=30;
Jump1='A';
sum_bill+=bill;
}
else if (choice==2&&Jump2!='B')
{bill=30;
Jump2='B';
sum_bill+=bill;
}
else if (choice==3&&Jump3!='C')
{bill=50;
Jump3='C';
sum_bill+=bill;
}
else if (choice==4&&Jump4!='D')
{bill=50;
Jump4='D';
sum_bill+=bill;
}
else
{
cout <<" You entered wrong category!";
faci++;
}
}
cout<<"Your total bill is >> " <
}
else
cout << " YoU have no bill for this " ;
all_bills=sum_price+bill_service+sum_bill+totalPrice;
cout << " Your total Hotel Bill is RM"<
cout <<"Thanks for staying at Paradise Bay Hotel!";
return 0;
}
void totalprice (int& r, double price, int& days)
{
while(r<1 || r>3)
{
cout << " PLEASE ENTER THE CORRECT CODE FOR YOUR BOOKING TYPE ";
cout << " Please select your room type (ENTER 1/2/3) >> ";
cin >> r;
}
if ( r == 1)
{
cout << "Details about the room : " << " Single bed " << " Wifi" << " Aircond" << " Shower";
price = 200;
}
else if (r == 2)
{
cout << " What type of bed do you prefer? ";
cout << " 1 >> Queen bed 2 >> King bed "<< endl;
cout << "Enter your choice in number : ";
cin >> k;
while (k<1||k>2)
{
cout << "Invalid input!Try again";
cout << " What type of bed do you prefer? ";
cout << " 1 >> Queen bed 2 >> King bed "<< endl;
cout << "Enter your choice in number : ";
cin >> k;
}
if (k==1)
cout<< " you choose : " << q_a<
else
cout<< " you choose : " << q_b<
price = 400;
}
else if (r==3)
{
cout << " What type of bed do you prefer? ";
cout << " 1 >> 2 Queen bed 2 >> 2 King bed 3 >> 1 King 1 Queen bed "<< endl;
cout << "Enter your choice in number : ";
cin >> e;
while (e<1||e>3)
{
cout << "Invalid input!Try again";
cout << " What type of bed do you prefer? ";
cout << " 1 >> 2 Queen bed 2 >> 2 King bed 3 >> 1 King 1 Queen bed "<< endl;
cout << "Enter your choice in number : ";
cin >> e;
}
if (e==1)
cout<< " you choose : " << p_a<
else if(e==2)
cout<< " you choose : " << p_b<
else
cout<< " you choose : " << p_c<
price = 600;
}
totalPrice = price*days;
}
void displaytotalprice (double& totalPrice)
{
cout << " The total price you need to pay for your stay is >> RM " << totalPrice << endl;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started