Total number of rooms on a particular floor

Assignment Help Basic Computer Science
Reference no: EM131775702

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: EM131775702

Questions Cloud

Link-local multicast name resolution : Link-Local Multicast Name Resolution (LLMNR) (defined by RFC 4795), is a protocol based on the DNS packet format. LLMNR allows IPv4 and IPv6 network.
Discuss impact of adhd on a childs schooling : Write a 750-1,000-word commentary that addresses a trend/topic related to ADHD. Discuss Impact of ADHD on a Child's Schooling.
Compute taxable income for the year : Compute taxable income for the year. For this computation, substitute MACRS depreciation in place of straightline depreciation
Computers through the traditional retail distribution system : Centel computers has tried selling its personal computers through the traditional retail distribution system.
Total number of rooms on a particular floor : Also, ensure the number of occupied rooms does not exceed the total number of rooms on a particular floor.
Show-stoppers in project risk management : What are the roles of the game changers and show-stoppers in project risk management?
Describe circumstances in which non-listening distorted : Describe specific circumstances in which non-listening distorted or damaged interpersonal relations with colleagues and/or bosses.
Calculate the final value of the cylinder rotation angle : The rotary mechanical system of Figure is formed of a cylinder with a mass moment of inertia J, a damper with a damping coefficient c.
Black swans and red herrings in risk management : 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