ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 19 May 2017 My Price 8.00

a hotel's occupancy rate

Can you please help me with this?

Hotel occupancy:

a hotel's occupancy rate is calculated as follows:

occupancy rate = number of rooms occupied / total number of rooms

Write a program that calculates and display the occupancy rate for each floor and the entire hotel. The program should start by asking for the number of floors in the hotel. Then a loop should 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 rooms that are occupied on that floor. Then the loop calculates and displays the occupancy rate for that floor.

After all the iterations, the program should display the total number of rooms the hotel has, the total number of rooms occupied in the hotel, and the total number of rooms that are vacant in the hotel, and the overall occupancy rate for the entire hotel.

Input validation:

  1. Do not accept a value less than 1 for the number of floors.
  2. Do not accept the number less than 10 for the number or rooms on a floor.
  3. Do not accept the number of occupied rooms on a floor greater than the number of available rooms for that floor

For example: A hotel has 4 floors.

Floor 1: 100 rooms, 60 occupied. Then the occupancy rate for floor 1 is 0.60.

Floor 2: 150 rooms, 90 occupied. Then the occupancy rate for floor 2 is 0.60

Floor 3: 60 rooms, 50 occupied. Then the occupancy rate for floor 3 is 0.86

Floor 4: 90 rooms, 45 occupied. The the occupancy rate for floor 4 is 0.50

Altogether, the hotel has 400 rooms, 245 rooms are occupied, 195 rooms are vacant. The overall occupancy rate for the hotel is 0.61

Requirements: turn in the .java file

 

Thank you!

Answers

(11)
Status NEW Posted 19 May 2017 06:05 AM My Price 8.00

-----------

Not Rated(0)