logo

write a program that calculates the occupancy ...

21 Sep 2021

write a program that calculates the occupancy rate of a hotel. The program should start by asking the user how many floors the hotel has. a loop should then iterate once for each floor. In each iteration, the loop should ask the user the number of rooms on the floor and how many of them are occupied. After all the iterations, the program should display how many rooms the hotel has, how many of them are occupied, how many of them are unoccupied, and the percentage of rooms that are occupied. The percentage may be calculated by dividing the number of rooms occupied by the number of rooms. INPUT VALIDATION: do not accept a value less than 1 for the number of floors.

Desklib

Looking for a correct answer fast?

or

Contact us at     +1 306 205-2269

Chat with our experts. we are online and ready to help.

Solutions

21 Sep 2021

The Python code snippet for the hotel occupancy problem is given below:  def hotel_occupancy(): number_of_floors = int(input("Enter the...

Get Expert Help

Related Questions

18-Apr-2024

how to describe five Porter's Life cycle ...

17-Apr-2024

research plan on the ethics in finance ...

12-Apr-2024

Help with my assignment please ...

10-Apr-2024

How does the Ukraine-Russian war increased transportation ...

10-Apr-2024

How does the Ukraine-Russian war increased transportation ...

08-Apr-2024

Explain page number 4 ...