Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

=+11. What are network extemalities and how do they lead to growth?

Answered: 1 week ago