using namespace std; #include int main() { int roomNum, nights; float roomRate, roomCost, roomTax, subTotal, phoneCost, extraCost, grandTotal; string name; const float tax = 0.0975; cout << "This program is used to generate a billing statement for" << endl << "the Murfreesboro Hotel Inc." << endl; // Start prompting for the guest details, such as... // ...their name... cout << "Guest name: "; cin >> name; // ...their room number... cout << "Room number: "; cin >> roomNum; // ...their room's nightly cost... cout << "Room rate: "; cin >> roomRate; // ...the number of nights they stayed... cout << "Number of nights: "; cin >> nights; // ...the costs incurred on their telephone... cout << "Telephone charges: "; cin >> phoneCost // ...and any other various costs. cout << "Other charges, such as meals: "; cin >> extraCost; // Now that we have all of our user input, we can start making a // few calculations. roomCost = roomRate * nights; // Total cost for renting the room. roomTax = roomCost * tax; // The tax for renting the room subTotal = roomCost + roomTax; // Subtotal, before other costs. grandTotal = subTotal + phoneCost + extraCost; // Wrap all of our costs together. // Give ourselves a bit of room before we start feeding the user the // billing statement. cout << endl << endl << endl << endl; // And now, the billing statement. Start pushing out all the // information requested. cout << "Guest name: " << name << endl << "Room number: " << roomNum << endl << "Room rate: $" << roomRate << endl << "Nights stayed: " << nights << endl << "Room cost: $" << roomCost << endl // For this segment, format the tax so it looks in a pretty // percentile format rather than a decimal. << "Tax @ " << tax * 100 << "%: $" << roomTax << endl << "Subtotal: $" << subTotal << endl << "Phone charge: $" << phoneCost << endl << "Other charge: $" << extraCost << endl << "GRAND TOTAL: $" << grandtotal << endl // A little bit more padding, to give room for the closing. << endl << endl // ...and a complimentary closing. << "Thank you for staying with us at Murfreesboro" << endl << "Hotel. We hope you enjoyed your stay." << endl; // Woohoo! We're done! return 0; }