Write a program that calculates the occupancy rate of the 120 suites (20 per flo
ID: 3625054 • Letter: W
Question
Write a program that calculates the occupancy rate of the 120 suites (20 per floor) located on the top 6 floors of a 15th floor luxury hotel. There are floors 10-12 and 14-16 because, like many hotels, there is no 13th floor. Solve the problem by using a single loop that loops once for each floor between 10 -16 and, on each iteration, ask the user to input the number of suites occupied on the floor. After all the iterations, the program should display how many suites the hotel has, how many of them are occupied, and what percentage of them are occupied. Input Validation: Do not accept less than 0 or more then 20 for the number of suites occupied on a given floor.Explanation / Answer
Try dis n let me knw.... #include #include int main() { clrscr(); int floors = 6, rooms = 20, suites = 120, occupied = 0, totalRooms = 120, totalOccupied = 0, totalUnoccupied = 0, numFloors=16; int occupRate; //store hotel occupancy rate for (int floor = 10; floorRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.