Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Directions: Write a program that calculates the occupancy rate for a hotel. This program will exercise the use of loops in a program. This should
Directions: Write a program that calculates the occupancy rate for a hotel. This program will exercise the use of loops in a program. This should be a review of topics from chapters and This assignment is to help students recall concepts learned in the previous course. You will be graded on program styles and structure, and execution of basic skills such as implementing loops.The program should start with a welcome message that gives the program name and a brief description of what the program does. pointsNext begin by asking the user how many floors the hotel has and store the user's input. points A loop should then iterate once for each floor. In each iteration, the loop should: pointsask the user for the number of rooms on the floor, ask the user for how many of the rooms are occupied, keep a running total of the number of total rooms and the number of occupied rooms.After all the iterations, the program should display: pointshow many total rooms the hotel has,how many of them are occupied,how many 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.This program must include loops. The displayed output should be wellspaced, readable and easy to follow. pointsThis assignment should be completed in a C compiler. Once complete, please save and submit the cpp file on Canvas.
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