Calculates the occupancy rate for a hotel

Assignment Help Basic Computer Science
Reference no: EM131779020

Hotel Occupancy

Make a program that calculates the occupancy rate for a hotel. The program should begin by prompting the user for the number of floors in the hotel. Use the following prompt:

Number of floors:

Input Validation: Do not accept a value less than 1 or greater than 20 for the number of floors.

A loop should then iterate once for each floor. For each iteration, the user should be prompted for the number of rooms on the floor and how many of them are occupied.

It is traditional that many hotels do not have a fourth and/or thirteenth floor so

don't allow for a 4th or 13th floor.

Use the following prompt:

Number of rooms on floor x: (x represents the floor number)

Number of occupied rooms:

Input Validation: Do not accept a value of less than 1 or more than 10 for the number of rooms on a floor. Also, ensure the number of occupied rooms does not exceed the total number of rooms on a particular floor.

The program should display the total number of rooms in the hotel, how many are occupied, how many are unoccupied, and the percentage of rooms that are occupied ( ie. occupancy rate).

Use the following format for your output:

Total number of rooms: xxx

Number of occupied rooms: xxx

Number of unoccupied rooms: xxx

Occupancy rate: xxx.x%

Note: You must use both 'while' and 'for' loop structures in your solution.

The user should be allowed to process as many "hotels" as needed without having to re-execute the program.

Reference no: EM131779020

Questions Cloud

Evidence of academically mature insight : Evidence of academically mature insight and use critical thinking skills in analyzing and relating the articles to each other.
Describe the pid algorithm : Consider the PID algorithm in For each of the individual modes-proportional, integral, and derivative-describe with a sketch the result of its calculation.
Compute inventory amounts at the end of each year : Compute inventory amounts at the end of each year, the National Furniture Company adopted the dollar-value LIFO method of computing inventory
Network nodes to perform name resolution : LLMNR allows IPv4 and IPv6 network nodes to perform name resolution for other devices connected to the same local link. How is it similar to DNS?
Calculates the occupancy rate for a hotel : Make a program that calculates the occupancy rate for a hotel. The program should begin by prompting the user for the number of floors in the hotel.
Discuss the three types of disturbances : Discuss the three types of disturbances described in this chapter and give a process example of how each could be generated by an upstream process.
Determine the reported inventory value : Determine the reported inventory value assuming the lower of cost and net realizable value rule is applied to individual trees
What amount of accrued liability would jackson have reported : What amount of accrued liability would Jackson have reported in its December 31, 2011, balance sheet
What are the roles of broiler black swans : What are the roles of broiler black swans and red herrings in risk management?

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