cant figure out how to get the floors and occupancy rate to show

Public Class Form1

Private Property occupancy As Integer

Private Property occupancysum As Integer

Private Sub GroupBox1_Enter(sender As System.Object, e As System.EventArgs) Handles GroupBox1.Enter

End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

    Dim intOccupancy(8) As Integer
    Dim intTotOccupancy As Integer = 0
    Dim decOccupancyRate As Decimal
    Dim intCount As Integer = 0
    Dim intRoomCount As Integer
    Dim intcounter As Integer = 0
    Dim inrooms As Integer = 0
    Dim strRooms As String = String.Empty
    Dim HotelOccupancy As String
    Dim rooms_per_Floor As Integer
    Dim MAX_FLOOR As Integer
    Dim richtextbox1 As String

    For i = 1 To 8
        intRoomCount = -1
        While intRoomCount < 0 Or intRoomCount > 30
            richtextbox1 = InputBox("Enter the number of rooms occupied.", "Floor: " & intCount)
            If IsNumeric(richtextbox1) Then intRoomCount = CInt(richtextbox1)
            If intRoomCount < 0 Or intRoomCount > 30 Then
                MessageBox.Show("Please enter a number between 0 and 30.")
            End If
        End While
        intOccupancy(intCount) = CDec(intRoomCount)
        intTotOccupancy = CDec(intTotOccupancy + intRoomCount)
        decOccupancyRate = CDec(CDec(intTotOccupancy) / 240.0)
        HotelOccupancy = ("Floor:" & intCount.ToString & " Rooms Occupied:" & intRoomCount.ToString & "OccupancyRate:" & intRoomCount / rooms_per_Floor).ToString
        richtextbox1 = HotelOccupancy
    Next
    TextBox1.Text = intTotOccupancy.ToString()
    TextBox2.Text = CStr(decOccupancyRate * 100) & "%"


    For floor As Integer = 1 To MAX_FLOOR
        occupancy = CInt(InputBox("Please enter the number of rooms" & "occupied on floor" & floor))
        occupancysum += occupancy
        richtextbox1.items.add = ("Floor: " & floor & " Rooms Occupied: " & occupancy & " Occupancy Rate: " & (occupancy / rooms_per_Floor) * 100 & "%")

    Next

For floor as Integer = 1 To MAX_FLOOR

MAX_FLOOR Doesn't have a value so that loop will never execute. You never set the value for MAX_FLOOR anywhere.

After this line--> richtextbox1 = InputBox("Enter the number of rooms occupied.", "Floor: " & intCount)

Place this line--> MAX_FLOOR += 1

This article has been dead for over six months. Start a new discussion instead.