Occupancy rate for floor

Assignment Help Basic Computer Science
Reference no: EM131218132

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

Reference no: EM131218132

Questions Cloud

Total amount of a meal purchased at a restaurant : Tip, Tax, and Total Design a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 15 percent tip and 7 percent sales tax...
Construct a budget that provide a breakdown : Identify the type of public organization for which you work, as well as what types of services, goods, or activities the organization provides to the public. Identify the size and scope of the organization.
Find a polynomial function that has zeros : Identify the left-hand and right-hand behavior of the graph of the polynomial function f(x) = 6x3- 5x + 4. Find a polynomial function that has zeros at -3, -1, and -2. Do not leave it in factored form, but multiply out your answer.
Review the hhs information security program : Review the HHS information security program. Select three to five points of analysis from the proposal (#1 above). Your points of analysis must be specific items from the legislative proposal or the legislation.
Occupancy rate for floor : 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.
Does it appear that movie critics like high-budget movies : Using regression, does it appear that critics and audience members agree on what a movie should be rated? Why or why not?
Responses in the form of a term paper : Select one (1) of the following topics in which you will base your responses in the form of a term paper:
Two figures from the humanities : Write a paper and include two figures from the Humanities.-  compare and contrast their achievements.
Begin with a workstation running : A suggested approach is to begin with a workstation running a web browser and trace a connection to a public web server (i.e. facebook; eBay; etc). As part of your narrative

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Develop a contingency plan for ipremier

Develop a contingency plan for iPremier to be better prepared for similar future events

  Minimum number of coins required to pay an amount

Find the formula of c[i, j], which is the minimum number of coins required to pay an amount of j units. 1≤i≤n is the denomination and i have value di units, 0≤j≤N is the amount of units. Then set up a table for c[1..n, 0..N]

  Disarm code consists of four digits

Problem 1: A burglar alarm key pad contains ten digits. The disarm code consists of four digits.

  Explain what type of architecture new payroll application

Explain what type of architecture the new payroll application

  Beneficial for bulky data accessing on page

Write a Program using Skip and Take operators. How can it beneficial for bulky data accessing on page?

  Employment or an organization

Explain this use in your current place of employment or an organization you are familiar with.

  Reduce the running time by at most a factor of two

Consider a program that accesses a single I/O device and compare unbuffered I/O to the use of a buffer. Show that the use of the buffer can reduce the running time by at most a factor of two.

  Successful in suppressing details of the decss

Search for a brief description of this case and its outcome. Determine whether the MPAA was successful in suppressing details of the DeCSS descrambling algorithm.

  Revise the implementation of the adt binary search tree

Revise the implementation of the ADT binary search tree to add this new feature by adding the data member last Accessed to the class.

  Discuss the role of system administrator

Discuss the role of system administrator and the skills necessary for net work administrator.

  Write guide for the organization

Write a 2-3 page report recommending style manual and/or technical/legal writing guide for the organization to use and describe the reasons for your recommendations.

  Describe what fraud is and how it could be conducted

In conversations with PVSS, you have talked about the long-term strategic goals and plans for expansion.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd