Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started