Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92587702
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question we are running the insertion sort algorithm on the

Question : We are running the Insertion Sort algorithm on the array A = . a) Write the array A at the start of the iteration j=5 of the for loop. b) What is the value of i at the start of the iteration j=6 of the for loo ...

Suppose that we have a block cipher and want to use it as a

Suppose that we have a block cipher and want to use it as a hash function. Let X be a specified constant and let M be a message consisting of a single block, where the block size is the size of the key in the block ciphe ...

Question summary on hypertext transfer protocol http

Question : Summary on Hypertext Transfer Protocol (HTTP) describing its major features, principles of operation and application in transferring traffic over the World Wide Web. The response must be typed, single spaced, ...

It is required to design an iterative combinational circuit

It is required to design an iterative combinational circuit that computes the equation Z=2*X-Y, where X and Y are n-bit unsigned numbers. (i) Determine the number of inputs and outputs needed for your 1-bit cell. (ii) De ...

Question capstone project - informationalthis part of the

Question: Capstone Project - Informational This part of the assignment is NOT FOR GRADING this week. This part of the assignment is to contribute to the capstone project and also to show the instructor that progress is b ...

In unix programming ordinarily the exec system call follows

In UNIX programming, ordinarily the exec() system call follows the fork() call. Explain what would happen if a programmer were to inadvertently place the call to exec() before the call to fork().

A summary of business activities of a course registration

A summary of business activities of a "Course Registration System" for enrolling courses for students and for enrolled class lists for faculty members at an online university is as follows: The Physics Department provide ...

What is the density of a piece of solid that weighs 675

What is the density of a piece of solid that weighs 6.75 grams and displaces 34.8 ml of water? Remember density is a measurement of mass per volume

Discuss how an enterprise architecture can establish

Discuss how an Enterprise Architecture can establish governance mechanisms?

A blaster rifle manufacturing facility on naboo has 6500

A blaster rifle manufacturing facility on Naboo has 6,500 employees. The employees were asked whether they preferred a four-day work week (10 hours per day), a five- day work week (8 hours per day), or flexible hours. Yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As