Question

In: Computer Science

Summary The cost of renting a room at a hotel is, say $100.00 per night. For...

Summary

The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a wedding or conference, the hotel offers a special discount as follows.

If the number of rooms booked is:

  • at least 10, the discount is 10%
  • at least 20, the discount is 20%
  • at least 30, the discount is 30%

Also if rooms are booked for at least three days, then there is an additional 5% discount.

Instructions

Write a program that prompts the user to enter:

  1. The cost of renting one room
  2. The number of rooms booked
  3. The number of days the rooms are booked
  4. The sales tax (as a percent).

The program outputs:

  1. The cost of renting one room
  2. The discount on each room as a percent
  3. The number of rooms booked
  4. The number of days the rooms are booked
  5. The total cost of the rooms
  6. The sales tax
  7. The total billing amount.

Your program must use appropriate named constants to store special values such as various discounts.

Since your program handles currency, make sure to use a data type that can store decimals with a precision to 2 decimals.

Solutions

Expert Solution

SOLUTION:-

#include<iostream>

using namespace std;

int main()

{

double rent, s_tax, discount = 0;

int n, days;

double roomRent, totalRent,sales_tax;

// Entry of user

cout<<"Enter the rent of one room:$ ";

cin>>rent;

cout<<"Enter the number of rooms to be booked: ";

cin>>n;

cout<<"Enter the number of days for which rooms need to be booked: ";

cin>>days;

cout<<"Enter the sales tax (in %): ";

cin>>s_tax;

// if rooms is greater than or equal to 30,give the discount of 30%

if(n>=30)

discount = 0.3;

// if rooms is greater than or equal to 20,give the discount of 20%

else if(n>=20)

discount = 0.2;

// if rooms is greater than or equal to 10,give the discount of 10%

else if(n>=10)

discount = 0.1;

// if days is greater than or equal to 3 add additional 5%

if(days>=3)

discount += 0.05;

// calculation of total rent

totalRent = rent*n*days*(1-discount);

roomRent = totalRent/n;

// print the output

cout<<"The cost of renting one room is "<<roomRent<<endl;

cout<<"The discount given is "<<100*discount<< "%.\n";

cout<<"The number of rooms booked is "<<n<<endl;

cout<<"The number of days rooms booked is "<<days<<endl;

cout<<"Total cost of the rooms = "<<totalRent<<endl;

sales_tax = (s_tax*totalRent)/100;

cout<<"Sales tax = "<<sales_tax<<endl;

// generate total bill

cout<<"Total bill = "<<totalRent + sales_tax<<endl;

return 0;

}


Related Solutions

] The average cost per night of a hotel room in San Francisco is $550 with...
] The average cost per night of a hotel room in San Francisco is $550 with a standard deviation is $150 based on a sample of 50 hotel room rates. a) Clearly state what the random variable in this problem is? b) What is an appropriate distribution to be used for finding the confidence intervals for this problem and why? c) Construct a 99% confidence interval estimate on the mean of all hotel room rates. d) What is the 90%...
If a hotel sells room nights for $80 with a $20 variable cost per room and...
If a hotel sells room nights for $80 with a $20 variable cost per room and incurs $17,000 in fixed expenses monthly. What is the breakeven revenue? $22,666.97 $22,666.87 $22,666.77 $22,666.67
The Harriet Hotel in downtown Boston has 100 rooms that rent for $150 per night. It costs the hotel $30 per room in variable costs
In Crystal BallThe Harriet Hotel in downtown Boston has 100 rooms that rent for $150 per night. It costs the hotel $30 per room in variable costs (cleaning, bathroom items, etc.) each night a room is occupied. For each reservation accepted, there is a 5% chance that the guest will not arrive. If the hotel overbooks, it costs $200 to compensate guests whose reservations cannot be honored.How many reservations should the hotel accept if it wants to maximize the average...
Glitz hotel, a 500-room hotel, rents hotel rooms for $120/night. At the current sales level of...
Glitz hotel, a 500-room hotel, rents hotel rooms for $120/night. At the current sales level of 400 rooms per night, Glitz currently makes a profit of $30/room:                                         Per room Sales                                 $120 Costs                                     90 Profit                                    30 It costs Glitz $90/night to maintain a room ($60 in depreciation, $25 in variable maintenance and $5 in fixed booking costs). Glitz has been approached by Conventions2000.com to purchase a block of 300 rooms for $80/room per night. If this special...
Sector hotel, a 500-room hotel, rents hotel rooms for $120/night. At the current sales level of...
Sector hotel, a 500-room hotel, rents hotel rooms for $120/night. At the current sales level of 400 rooms per night, Glitz currently makes a profit of $30/room:                                    Per room Sales                          $120 Costs                              90 Profit                              30 It costs Sector $90/night to maintain a room ($60 in depreciation, $25 in variable maintenance and $5 in fixed booking costs). Sector has been approached by Conventions2000.com to purchase a block of 300 rooms for $80/room per night. If this special...
A 300-room hotel in Las Vegas is filled to capacity every night at $80 a room....
A 300-room hotel in Las Vegas is filled to capacity every night at $80 a room. For each $1 increase in rent, 3 fewer rooms are rented. At what rate should the rooms be rented to produce the maximum revenue and how many rooms are rented at that rate? What is the maximum revenue? Write your results in a sentence as what each number means and represents. Please include all steps needed
A small hotel has 50 rooms that rent for $105 per night and cost $45 to...
A small hotel has 50 rooms that rent for $105 per night and cost $45 to clean and prepare each night they are used. All rentals are by reservation and there is a 10% chance that an individual reservation will not show up. If a customer arrives at the hotel with a reservation and no room is available due to overbooking, the hotel will refund the cost of the room and pay $150 to put the customer up at another...
The Tired Traveler Motel rents rooms for $50 per night. The variable cost per room rental...
The Tired Traveler Motel rents rooms for $50 per night. The variable cost per room rental is $10. The company incurs $300,000 of fixed costs per year. The company expects to rent 10,000 rooms in the coming year. a. Based on these data, prepare a static budget for the coming year. b. Holding all other factors constant, how would net income differ from the static budget if sales price was 10 percent lower than expected? c. Holding all other factors...
The Hotel El Politécnico has # 500 rooms. They usually have a cost per room of...
The Hotel El Politécnico has # 500 rooms. They usually have a cost per room of $ 70.00, plus a fixed cost of $ 5,000.00 per day. Each room is rented for $ 175.00 per day during the summer season. Answer the following questions using the above data: a) If the Hotel operates at 70% capacity for one day, what is the net profit (gain / loss)? b) What is the equilibrium point (B. E. P.)? in units, if it...
New York City is the most expensive city in the United States for lodging. The mean hotel room rate is $204 per night.
  New York City is the most expensive city in the United States for lodging. The mean hotel room rate is $204 per night. Assume that room rates are normally distributed with a standard deviation of $55. (a) What is the probability that a hotel room costs $265 or more per night? (Round your answer to four decimal places.) (b) What is the probability that a hotel room costs less than $120 per night? (Round your answer to four decimal...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT