The Paris Hotels Company needs a computer program to track their hotel occupancy for the hotels in their chain. Write a Java program that calculates the occupancy rate for each floor of a hotel. A hotel’s occupancy rate is calculated as follows: Occupancy rate = number of rooms occupied / number of rooms The program should start by asking for the number of floors int the hotel. A loop should then iterate once for each floor. During each iteration the loop should ask the user for the number of rooms on the floor and the number of those rooms that are occupied. The occupancy rate should be displayed for each floor. After all the iterations, the program should display the number of rooms the hotel has, the number of those rooms that are occupied, the number that are vacant, and the occupancy rate for the hotel. Input Validation: Do not accept a value less than one for the number of floors. Do not accept a number less than 10 for the number of rooms on a floor. Requirements: Name your program Hotel.java and submit it on the Moodle website. Include comments defining the purpose of the code. Include a comment giving your name.

The purpose of the program is to calculate the occupancy rate for each floor of a hotel in the Paris Hotels Company’s chain. The program will take input from the user regarding the number of floors and the number of rooms on each floor, as well as the number of rooms that are occupied.

To start, the program should prompt the user to enter the number of floors in the hotel. This value should be an integer greater than or equal to 1. If the user enters a value less than 1, the program should display an error message and prompt the user again for a valid value. Once a valid number of floors is entered, the program should proceed with the calculation.

The program should then use a loop to iterate once for each floor in the hotel. Inside the loop, the program should prompt the user to enter the number of rooms on the current floor. This value should be an integer greater than or equal to 10. If the user enters a value less than 10, the program should display an error message and prompt the user again for a valid value.

After obtaining the number of rooms on the floor, the program should prompt the user to enter the number of rooms that are occupied on that floor. This value should be an integer greater than or equal to 0 and less than or equal to the total number of rooms on the floor. If the user enters a value outside this range, the program should display an error message and prompt the user again for a valid value.

Once the number of rooms and the number of occupied rooms on the floor have been obtained, the program should calculate the occupancy rate for that floor using the formula: occupancy rate = number of rooms occupied / number of rooms. This value should be displayed to the user.

The loop should continue for each floor in the hotel, repeating the process of obtaining the number of rooms and the number of occupied rooms, and calculating the occupancy rate.

After the loop ends, the program should display the following information: the total number of rooms in the hotel, the total number of rooms that are occupied, the number of vacant rooms (which can be calculated as the difference between the total number of rooms and the total number of occupied rooms), and the overall occupancy rate for the hotel.

The program should be named Hotel.java and submitted on the Moodle website. It should include comments throughout the code to explain the purpose and functionality of each section. Additionally, your name should be specified with a comment.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer