Question: #include // Include here the libraries that your program needs to compile using namespace std; // Insert here your function prototype int main() { //

#include

// Include here the libraries that your program needs to compile

using namespace std;

// Insert here your function prototype

int main() { // Enter here all the statements needed to use the input file // Check if there was an error opening the input file

// Call the function to print the occupancy table

// Close the input file

return 0; }

//************************ Function definitions ************************* // Read the handout carefully for detailed description of the functions that you have to implement

// This function receives an input file with data about rooms in a hotel. // Each row of the file represents a floor in the hotel. You do not know ahead of time how many floors there are in the hotel. // Each room is represented by a single digit: 1 (the room is occupied) or 0 (the room is not occupied). // Because each floor can have a different number of rooms, the value -1 is used to indicate that the end of data for that floor has been reached. // The function must print the header of the table followed by the floor number, the number of rooms occupied in that floor, and the occupancy // rate (percentage of rooms occupied) for that floor. Below this information it must display the // overall occupancy rate (total number of occupied rooms/total number of rooms) for the whole hotel. // The rates must be displayed real numbers with a single decimal digit.

Run my sample solution to know how your program must behave. Pay attention to the input and the output formats. Your solution must behave exactly like mine.

https://replit.com/@GDietrich/1470-lab16sample

 #include// Include here the libraries that your program needs to compile

You must define the most appropriate type of function, the parameter list (using the most appropriate parameters), and the body of the function to be implemented. You must use the most appropriate type of loops to solve the problem. C\\WINDOWS\\system32\\c... X Floor | Occupants Rate (x) A 19 67.9 12 60.0 70 .8 6 28-6 4 57.1 SHOW JOULAWNH 8 44.4 11 50.0 15 68-2 9 42.9 16 94.1 11 5 45 .5 12 10 62.5 13 15 53.6 14 14 100.0 The overall occupancy rate is: 59.9% Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!