enter the number of nights, per night rate room service charge, and telephone charge
calculate the room charge by multiplying the numbr of nights by the per-night rate
calculate the total bill by adding together the room charge, room service charge, and telephone charge
display the total bill
include <iostream>
using namespace std;
int main()
{
double night_rate;
double number_nights;
double room_service;
double telephone_charge;
double room_charge;
double total_bill;
cerr<<"enter the per-night rate: ";
cin>>night_rate;
cerr<<"Enter the number of nights: ";
cin>>number_nights;
cerr<<"Enter your room service fee: ";
cin>>room_service;
cerr<<"Enter your phone fee:";
cin>>telephone_charge;
room_charge = night_rate*number_nights;
total_bill = room_charge+room_service+telephone_charge;
cerr<<"The total bill was: "<<total_bill;
return 0;
}
Comments
Leave a comment