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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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