> How do you write this in pseudocode?

How do you write this in pseudocode?

Posted at: 2014-12-18 
You just write what your code would be, but in plain English.

I don't know how you are going to do it but...

Dim variable for hotel floors

dim variable for hotel rooms total

dim variable for hotel rooms on given floor

hotel floors = userinput box

I don't know why you'd use a for loop to test that a hotel is greater than 1 floor, I would do

if hotel floors <1 then

messagebox error message

exit sub

end if

then I would carry on with the loops to calculate the rooms per floor.

Start

Initialize Occupancy rate and Total Occupancy rate

Prompt number of floors in hotel

If (number of floors<=1)

Initialize counter to zero

Print "Error Message"

Prompt number of floor

End If

While (counter
Initialize counter to zero

Prompt number of rooms occupied

Prompt number of rooms

Occupancy rate=(number of rooms occupied/number of rooms on floor)/counter

Print Occupancy rate

total Occupancy rate=Total Occupancy rate + Occupancy rate

counter++

End While

Print (Total Occupancy Rate/(counter-1))

End

Hotel occupancy:

a hotel's occupancy rate is calculated as follows:

occupancy rate = number of rooms occupied / total number of rooms

Write a program that calculates the occupancy rate for each floor of the hotel and the entire hotel.

The program should:

1. ask for the number of floors in the hotel.

2. use a while loop to make sure the number of floor is greater than or equal to one. Display an error message and get a new input when the number of floor is less than 1.

3. Use another loop to iterate once for each floor. During each iteration, the loop should ask the user for the number of rooms on the floor and the number of rooms that are occupied on that floor. Then the loop calculate and display the occupancy rate for that floor using the formula above.

4. calculate and display the occupancy rate for the whole hotel