Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that calculates the occupancy rate for a hotel. The program should start by asking the user how many floors the hotel has.

Write a program that calculates the occupancy rate for a hotel. The program should start by asking the user how many floors the hotel has. A while loop should then iterate once for each floor. In each iteration, the loop should as the user for the number of rooms on the floor, and how many of the rooms are occupied. After all the iterations, the program should display how many rooms the hotel has, how many rooms are occupied, how many rooms are unoccupied, and the percentage of rooms that are unoccupied.

It is traditional that most hotels do not have a thirteenth floor. The loop in this program should skip the entire thirteenth iteration. (Saying 15 floors really means the top floor is labeled as 15, but there are really only 14 floors.) Do not let your program accept a value of less than one for the number of floors. Do not accept less than 10 for the number of rooms on a floor.

**Use C/C++ and please when making the program only use the while() function for loops instead of the for() function. This is vital to the assignment.

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

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions

Question

explain what is meant by redundancy

Answered: 1 week ago