Question
your skills in writing programs. Problem Specification: Write a Python program to calculate the occupancy rate of the suites located on the top 6 floors
your skills in writing programs.
Problem Specification:
Write a Python program to calculate the occupancy rate of the suites located on the top 6 floors of a 15-story luxury hotel. the program should calculate:
The number of suites the hotel has on those floors.
The number of suites that are occupied on those floors.
The percentage of them that are occupied.
Number of suites on floor 10 : 3
The number of Occupied suites = : 2
Number of suites on floor 11 : 3
The number of Occupied suites = : 2
Number of suites on floor 12 : 3
The number of Occupied suites = : 2
Number of suites on floor 14 : 5
The number of Occupied suites = : 4
Number of suites on floor 15 : 5
The number of Occupied suites = : 4
Number of suites on floor 16 : 5
The number of Occupied suites = : 4
Requirements:
Solve the problem by using a single for loop that repeats once for each floor between 10 and 16.
The floors are 10 -12 and 14-16 because, there is no 13th floor, you have to skip the 13th floor.
because the number of suites vary from floor to floor, we must ask the user to input the number of suites on each floor, and the number of occupied suites there.
Use a nested while loop to validate that the value entered for occupied suites is between 0 and the number of suites on the given floor.
At the end, we need to print one of the following messages:
Poor Occupancy, if the occupancy rate is less than 50.00%
Acceptable Occupancy, if the occupancy rate is between 50.00% and 75.00%
Excellent Occupancy, if the occupancy rate is above 75.00%
Sample output:
Total Suites : 24
Total Occupied Suites : 18
Occupancy Percentage : 75.00% Acceptable Occupancy
press Enter to Continue
Grading criteria:
5 points Proper comments, spacing, and general program appearance.
5 points descriptive variable names are used.
10 points A for loop repeats starting at 10 and ending at 16.
5 points The 13th floor is skipped.
10 points A while loop repeats if an invalid occupancy value is entered.
5 points number of suites is printed and is correct.
5 points number of occupied suites is printed and is correct.
10 points overall percentage of occupied is printed to the nearest 2 decimal places and is correct.
5 points A message is printed
10 points A flowchart is handed-in, detailed, and is correct.
10 points program is neat and clear, there are no extra lines, and only needed code is used.
5 points the function main () is called and screen is paused.
10 points Program runs correctly and produces the intended results.
5 points test runs to account for all outcomes are submitted.
Submission Details:
Submit a print-out of:
The source file (script)
A flowchart of main only (pseudo code is not acceptable)
Test runs to demonstrate all possible scenarios.
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