| loveshack (1) | |||
|
New here, but i cant seem to fix this code. Very new to C++ if someone could help me out here that would be great.
i realize that the code isn't complete, but that's the help i need. I need help finishing it and correcting the many errors i have. Here are the instruction I am attempting to follow: Write a complete C++ program to calculate the occupancy rate for the HeartBreak Hotel. The program should begin by asking for the number of floors. The program should then ask for the total number of rooms on each floor and how many of those are currently occupied. After all the floor information is entered, the program displays how many total rooms the hotel has, how many of them are occupied, how many are unoccupied and the percentage of rooms that are occupied. Also print which floor is the Heartbreak floor – that is, the floor with the most empty rooms. Additional Requirements: • You may use a for loops for your looping control structure. • Your program should validate that the number of floors is at least 1. Use a while loop to validate the input and display an appropriate error message. • Each floor must have at least 10 rooms. Use a while loop to validate the input and display an appropriate error message. • The number of rooms occupied for each floor must not exceed the number of room on the floor and cannot be less than zero. Use a while loop to validate the input and display an appropriate error message. • The HeartBreak Hotel is renovating the 2nd floor. The loop in this program should skip all processing of the 2nd floor. • Display the percentage value in standard percent format with one decimal place. program looks like this when ran How many floors does the hotel have? How many rooms are on floor 1 how many of those are occupied how many rooms are on floor 3 how many are occupied etc, etc then the final summing up of all the info thanks again for everything | |||
|
|
|||
| AbstractionAnon (412) | |
|
Line 22: Statement is incomplete. Line 23: You've written the functions you need, but you don't call them. Line 26-30: The variables you're outputting are all uninitialized. Line 53: Why are you passing occ? You don't use it. Line 55: Total rooms is uninitialized. Line 56: You want to loop though the number of floors, not the number of rooms. You need to pass in the number of floors. Line 77: Again you want to loop through the number of floors, not the number of rooms. Line 88: totalocc is undefined. Line 98: occ is undefined, | |
|
|
|