Hotel Bill Program

having trouble with this program was able to compile and fully do it just not correctly bc I hard coded the numbers and didnt use the variables correctly and confused on what I need to do HELP PLEASE

#include <iostream>
using namespace std;


int main()
{

double room_charge;
double total_resort_fee;
double total_charge;
double resort_tax;
double deposit;
double checkin;


cout << " Length of stay = 6 days \n";
cout << " Daily Rate = $100 \n";
cout << " Daily Resort Fee = $10 \n";
cout << " Resort Tax Rate = 0.085 \n";

cout << "Itemized Bill:\n";
room_charge = 6 * 100;
total_resort_fee = 10 * 6;
total_charge = room_charge + (total_resort_fee) + 56.1;
resort_tax = 0.085 * (total_charge);
deposit = 66;
checkin = total_charge - deposit;

cout << "Total Room Charge = "<<room_charge<<endl;
cout << "Total Resort Fee = " << total_resort_fee <<endl;
cout << "Total Resort Tax = " << resort_tax <<endl;
cout << "Total Bill = " << total_charge<<endl;
cout << "Total deposit =" << deposit<<endl;
cout << " Amount due at check in =" << checkin<<endl;
system("pause");
return 0;




these are me remarks from my teacher

You need to initialize your variables to the values given in the assignment.

double roomRate = 100, depositRate = 0.10, resortFee = 10.00, resortTax = .085;

int numDays = 6;

Then use the variables, not the numbers in your code.

cout << " Length of stay = " << numDays<< " days \n";

room_charge = numDays * roomRate;

Need variable days initialized to 6, roomRate initialized to 100.0, resortFee initialed to 10, then use those variables instead of hard coded numbers in your calculations:

room_charge = 6 * 100;
total_resort_fee = 10 * 6;
total_charge = 600 + (10*6) + 56.1;
resort_tax = 0.085 * total_charge;

i can attach more info if needed
Last edited on
You have comments from your teacher already. I don't understand what you need from us.
Topic archived. No new replies allowed.