In: Computer Science
For this assignment you will be creating a basic Hotel Reservation System. The program must meet the following guidelines:
Make sure you are using Variables, Looping, and decision statements!
Answer: Hey! Kindly find your solution here. You didn't mention any particular language in question that's why I used here c++ for this program. This program is error-free and working well. If you any queries, feel free to ask me. Thanks.
#include<iostream>
#include<iomanip>
#include<stdlib.h>
using namespace std;
int main()
{
float grand_total=0,tax,total;
int bed_num,n;
char ocean_view,fridge,pets,suite,bed;
cout<<"Hotel Reservation System";
cout<<endl<<"How many rooms do you want to
book?";
cout<<endl<<"you can upto 3 rooms at a
time";
cin>>n;
cout<<endl<<"Please answer below questions
to determine the cost of a room";
for(int i=1;i<=n;i++)
{
total = 0;
cout<<endl<<"Do you
want to book a Suite?Y/N";
cin>>suite;
if(suite=='Y')
{
total =
total+250;
}
else
{
exit(0);
}
cout<<endl<<"Which type
of bed do you want? Please enter a letter-";
cout<<endl<<"Q-queen or
K-king";
cin>>bed;
cout<<endl<<"How many
bed do you want?";
cin>>bed_num;
if(bed=='Q')
{
total =
total+bed_num*75;
}
else
if(bed=='K')
{
total =
total+bed_num*175;
}
cout<<endl<<"Do you
want Ocean view from room?Y/N";
cin>>ocean_view;
if(ocean_view=='Y')
{
total =
total+50;
}
cout<<endl<<"Do you
want Fridge at your room?Y/N";
cin>>fridge;
if(fridge=='Y')
{
total =
total+25;
}
cout<<endl<<"Do you
have pet?Y/N";
cin>>pets;
if(pets=='Y')
{
total
=total+50;
}
tax = total*5.5/100;
total = total+tax;
grand_total =
grand_total+total;
}
cout<<fixed<<setprecision(2)<<"Room's
"<<"cost is: $"<<grand_total;
return 0;
}