Problem

Hotel OccupancyThe ElGrande Hotel has eight floors and 30 rooms on each floor. Create an a...

Hotel Occupancy

The ElGrande Hotel has eight floors and 30 rooms on each floor. Create an application that calculates the occupancy rate for each floor, and the overall occupancy rate for the hotel. The occupancy rate is the percentage of rooms occupied, and may be calculated by dividing the number of rooms occupied by the number of rooms. For example, if 18 rooms on the first floor are occupied, the occupancy rate is as follows:

18/30 = .6 or 60%

The application’s form should appear similar to the one shown in Figure 1.

Figure 1 Hotel Occupancy form

When the user clicks the Complete Report button, a loop should execute and iterate eight times. Each time the loop iterates, it should display an input box for one of the hotel’s floors. The input box should ask the user to enter the number of rooms occupied on that floor. As the user enters a value for each floor, the loop should calculate the occupancy rate for that floor, and display the information for that floor in the list box. When the number of occupied rooms has been entered for all the floors, the application should display the total number of rooms occupied and the overall occupancy rate for the hotel. (The hotel has a total of 240 rooms.)

Figure 2 shows an example of the form after occupancy information has been provided for all the floors.

The Clear button should clear all the appropriate controls on the form. The Exit button should end the application. Use the values shown in Figure 2 to confirm that your application is performing the correct calculations.

Figure 2 Completed Hotel Occupancy form

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT