How many floors does the hotel have

Assignment Help JAVA Programming
Reference no: EM131590776

Hotel Occupancy A hotel's occupancy rate is calculated as follows:

Occupancy rate = number of rooms occupied div ÷ total number of rooms Write a program that calculates the occupancy rate for each floor of a hotel. The program should start by asking for the number of floors that the hotel has.

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 how many of them are occupied.

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

Input Validation: Do not accept a value less than 1 for the number of floors. Do not accept a number less than 10 for the number of rooms on a floor. Sample run: How many floors does the hotel have?

5 How many rooms does floor 1 have? 20 How many occupied rooms does floor 1 have? 10 How many rooms does floor 2 have?

10 How many occupied rooms does floor 2 have?

5 How many rooms does floor 3 have?

12 How many occupied rooms does floor 3 have? 13 Invalid.

Must be 12 or less. Re-enter: 10 How many rooms does floor 4 have? 10 How many occupied rooms does floor 4 have? 5 How many rooms does floor 5 have? 10 How many occupied rooms does floor 5 have? 2 Number of rooms: 62 Occupied rooms: 32 Vacant rooms: 30 Occupancy rate: 0.5161290322580645

Reference no: EM131590776

Questions Cloud

Prepare and submit a form 1040 for norman and leslie beber : Prepare and submit a Form 1040 for Norman and Leslie Beber for 2014. The Bebers do not donate to the presidential election campaign
Create a chart comparing the above topics with two other pro : The Internet to conduct research and gather statistics on how the law enforcement profession differs from other professions in terms
What are the costs of the massive expansion of information : Business intelligence, knowledge management, and expert systems are powerful tools that allow corporations to analyze huge amounts of data.
What will be the new portfolio beta : What will be the new portfolio beta if you keep 70 percent of your money in the old portfolio and 30 percent in a stock with a beta of 1.64?
How many floors does the hotel have : How many floors does the hotel have - How many occupied rooms does floor 1 have? 10 How many rooms does floor 2 have?
Magnitude of the electric force : What is the magnitude of the electric force on one of the masses?
Explain your reasoning and provide research : How have your metacognitive experiences in this course influenced your desire to better understand learning in comparison to others?
Calculate depreciation expense per mile : Linton Company purchased a delivery truck for $30,000 on January 1, 2017. Calculate depreciation expense per mile under units-of-activity method
Particle accelerator than in the computer monitor : How many times heavier is the electron in the particle accelerator than in the computer monitor?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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