here is the code I have so farThe program is a hotel occupancy form
The Hotel has eight floors and 30 rooms oneach floor. I'm supposed to create aapplication that calculates the occupancy rate for the hotel. Theoccupancy rate is the percentage of rooms occupied, and may becalculated by dividing the number of rooms occupied by the number ofrooms. For example, if 18 rooms on the first floor are occupied, the occupancyrate is: 18/30 = .6 or 60%.
The form has two out labels called totalrooms occupied and overall occupancy rate that holds two output text boxes todisplay the numbers
its only three buttons Calculate report,close, and exit Its obvious what the exit buttons issupposed to do the clear button should clear all the controls on the floor
Now the complete report button is supposedto loop and iterate eight times. Each time the loop iterates, it should displaya input box for one of the hotel floor. The input box should ask the user asksthe user the user to enter the number of rooms occupied on each floor. As theuser enters a value for each floor, the loop should calculate the occupancyrate for that floor and display the information for that floor in a list box.When the number of occupied rooms has been entered for all floors theapplication should display total number of rooms occupied an overall occupancyrate for the hotel. (the hotel has a total of 240 rooms total)
Option Strict On Option Explicit On Public Class frmHotelOccupancy Private SubbtnCompleteReport_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles btnCompleteReport.Click DimstrNumberRooms As String DimintTotalRooms As Integer = 240 DimintRoomsOccupied As Integer = 30 DimintOccupiedRooms As Integer = 0 Do ' Get number of rooms from the user strNumberRooms = InputBox("Enter the number of rooms occupied on thefloor", "Number of Rooms") ' Add the new item to the list If CInt(strNumberRooms) < 30 Then lstHotelOccupancy.Items.Add(strNumberRooms) End If ' Until they don't make an entry Loop Until(strNumberRooms.Trim = "Rooms occupied") 'Calculationfor determining the rooms occupied 'Loop for 8floors and percentage of rooms occupied ' End Sub Private SubbtnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles btnClear.Click End Sub Private SubbtnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles btnExit.Click End Sub End Class
If someone can answer me back soon it wouldbe so appreciated, Thanks