S ample Input : P lease enter the following Information. Date: 3-5-17 Customer\'
ID: 3858582 • Letter: S
Question
Sample Input:
Please enter the following Information.
Date: 3-5-17
Customer's Name: The John Smith Family
Room Number: 135
Room Rate: 39.95
Number of Nights: 3
Phone Charge: 3.75
Sample Output:
The Holiday Out Motel
Date: 3-5-17
Customer's Name: The John Smith Family
Room Number: 135
Room Rate $ 39.95
Number of Nights: 3
Room Cost: $ 119.85
Taxes $ 6.59
Subtotal: $ 126.44
Phone Charges: $ 3.75
TOTAL DUE: $ 130.19
Thank you for staying at the Holiday Out Motel.
Drive safely and please come again.
Would you like to process another customer’s bill (Y or N): n
Explanation / Answer
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
string date;
string name;
int roomNo;
double roomRate;
int numOfNight;
double mCharge;
int quit =0;
while(!quit){
cout << "Enter Date :" << endl;
cin >> date;
cout << "Enter Name :" << endl;
cin >> name;
cout << "Enter Room no :" << endl;
cin >> roomNo;
cout << "Enter Room Rate :" << endl;
cin >> roomRate;
cout << "Enter Number of Nights :" << endl;
cin >> numOfNight;
cout << "Enter Mobile Charge :" << endl;
cin >> mCharge;
cout << "The Hodiday Out Motel :" << endl;
cout << "=======================================" << endl;
cout << "Date :" <<date<< endl;
cout << "Customer's Name :" <<name<< endl;
cout << "Room Number :" <<roomNo<< endl;
cout << "Room Rate :" <<roomRate<< endl;
cout << "Number of Nights :" <<numOfNight<< endl;
double roomCost = roomRate*numOfNight;
cout << "Room Cost :" <<roomCost<< endl;
cout << "Taxes :" <<((roomCost/100.0d)*5.5d)<< endl;
cout << "---------------------------------------" << endl;
cout << "Sub Total :" <<(((roomCost/100.0d)*5.5d)+roomCost)<< endl;
cout << "Mobile Charge :" <<mCharge<< endl;
cout << "=======================================" << endl;
cout << "TOTAL DUE :" <<(((roomCost/100.0d)*5.5d)+roomCost+mCharge)<< endl<<endl;
cout << "Thank you for staying at the Holiday Out Motel. Drive safely and please come again."<<endl<<endl;
cout << "Would you like to process another custome's record (Y/N):"<< endl;
char ch;
cin >> ch;
if(ch =='Y'||ch=='y'){
continue;
}
break;
}
return 0;
}
///=================OUTPUT==============================
Enter Date :
22-3-217
Enter Name :
LOKNATH
Enter Room no :
135
Enter Room Rate :
39.95
Enter Number of Nights :
3
Enter Mobile Charge :
3.75
3.75
The Hodiday Out Motel :
=======================================
Date :22-3-217
Customer's Name :LOKNATH
Room Number :135
Room Rate :39.95
Number of Nights :3
Room Cost :119.85
Taxes :6.59175
---------------------------------------
Sub Total :126.442
Mobile Charge :3.75
=======================================
TOTAL DUE :130.192
Thank you for staying at the Holiday Out Motel.
Drive safely and please come again.
Would you like to process another custome's record (Y/N):
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.