Professional Documents
Culture Documents
02
03
04
05
06
07
08
09
' Calculate the occupancy rate for each floor, the total of all
occupancy rates, and the total rooms occupied.
10
lstOutput.Items.Clear()
11
12
13
14
15
16
occupancySum += occupancy
lstOutput.Items.Add("Floor " & floor & " is " & (occupancy /
ROOMS_PER_FLOOR) * 100 & "% full.")
Next
lstOutput.Items.Add("Total occupancy is " & occupancySum & " rooms
- " & (occupancySum / (ROOMS_PER_FLOOR * MAX_FLOOR)) * 100 & "% full.")
17
18
End Sub
19
20
21
22
23
24
25
26
Me.Close()
End Sub
27
28
30
lstOutput.Items.Clear()
31
lblOccupancyRate.Text = String.Empty
32
lblTotalOccupied.Text = String.Empty
33
End Sub
34 End Class