Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ write a program that calculates the occupancy rate for a hotel. The program should meet the following requirements: Displays a title, and welcome

In C++ write a program that calculates the occupancy rate for a hotel.

The program should meet the following requirements:

Displays a title, and welcome message to the user.

Ask the user how many floors the hotel has (do not accept an answer less than 1).

For each floor, ask the user to enter the total number of rooms.

For each floor, ask the user if any rooms are currently occupied (the amount occupied should never surpass the total number of rooms on that floor). Allow the user to respond with only Y or N (If the users anything other than these responses, display an error message and ask the user to respond accordingly. If the answer is Y, ask the user to enter the number of rooms that are currently occupied.

The programs final output should contain:

1) The total number of rooms on each floor.

2) The number of rooms currently occupied on each floor.

3) The number of rooms currently unoccupied on each floor.

4) The floors occupancy rate (Number of rooms currently occupied divided by the total number of rooms)

A summary of the entire hotel that includes

1) The number of floors

2) The number of rooms occupied

3) The number of rooms unoccupied

4) The hotels occupancy rate (Number of rooms currently occupied divided by the total number of rooms in the hotel)

The output should resemble the following:

*****************************

Hotel Occupancy Calculator

*****************************

Welcome to the Hotel Occupancy Calculator. Our system will allow you to enter information for your hotel and see the occupancy rates in detail.

Floor Rooms Available Occupied Occupancy Rate

--

Floor 1 20 5 15. 75

-

Floor 2 12 5 7 58.33

Hotel Summary

Number of Rooms: 32

Available Rooms: 10

Occupied Rooms: 22

Occupancy Rate: 68.75%

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

what is the method for a thick cylinder apparatus experiment?

Answered: 1 week ago

Question

Describe the basic structure of a union.

Answered: 1 week ago

Question

Discuss laws affecting collective bargaining.

Answered: 1 week ago