Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.:- M92584384
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

You get hired as a machine learning expert at moviescom

You get hired as a Machine learning expert at movies.com. Your task on day one is to improve the performance of a classifier. You divide the data into 2 parts training, and testing. You learn a model from the training da ...

Why is formative evaluation importantprovide at least three

Why is formative evaluation important? Provide at least three reasons for using it. What is the difference between formative and summative evaluation? Provide any two types formative evaluation and two types of summative ...

20 of students take finite math 30 take history and 5 take

20% of students take Finite Math, 30% take History, and 5% take both Finite Math and History. If a single student is chosen at random, find the probability that the randomly selected student is taking Finite Math given t ...

Letang industrial systems company lisc is trying to decide

Letang Industrial Systems Company (LISC) is trying to decide between two different conveyor belt systems. System A costs $300,000, has a four-year life, and requires $101,000 in pretax annual operating costs. System B co ...

What is the supply curve how do you apply the law of supply

What is the supply curve, how do you apply the law of supply in economics?

Question suppose a payroll system secretly leaks a list of

Question : Suppose a payroll system secretly leaks a list of names of employees earning more than a certain amount each pay period. Who would be harmed by such a vulnerability? How could such a vulnerability come about? ...

Question suppose that the tuition for a university is 10000

Question : Suppose that the tuition for a university is $10,000 this year and increases 5% every year. In one year, the tuition will be $10, 500. Write a program that displays the tuition in ten years and the total cost ...

A stock is expected to pay a 400 dividend per share the

A stock is expected to pay a $4.00 dividend per share. The growth rate is expected to be 5%. If investors demand 10% on this stock, what is the expected price of the stock 10 years from now?

Sql using oraclethe task is to remove suffix from last name

SQL using Oracle. The task is to remove suffix from last name column (e.g. Smith Sr. or Stevens Jr.) and put into the preexisting suffix column in the DB. Final result needs to be in the last name column: Smith or Steven ...

Question wireless transmission please respond to the

Question: Wireless Transmission" Please respond to the following: • Organizations need to be careful about their wireless transmissions and controlling the reception of the wireless signal. Discuss ways that organization ...

  • 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