Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For Fig 5-50 list all control types, names, properties, and values. For Fig 5-51

ID: 3690189 • Letter: F

Question


For Fig 5-50 list all control types, names, properties, and values.

For Fig 5-51 Create the VB code that will display the correct calculations as shown.

Total Rooms Occupied and Overall Occupancy Rates are labels.

First part of textbook's programming challenges question #4 Hotel Occupancy.
Visual Basic 2012 authors Tony Gaddis and Kip Irvine.


Programming Challenges 349 The application's form should appear similar to the one shown in Figure S-S0 Eloure 5-50 Hotel Occupancy form Figure When the user clicks the Complete Report button, a loop should execute and iterate eight times. Each time the loop iterates, it should display an input box for one of the hotel's floors. The input box should ask the user to enter the number of rooms oc- cupied on that floor. As the user enters a value for each floor, the loop should calcu- late the occupancy rate for that floor and display the information for that floor in the list box. When the number of occupied rooms has been entered for all the floors, the application should display the total number of rooms occupied and the overall occupancy rate for the hotel. (The hotel has a total of 240 rooms.) Figure S-$1 shows an example of the form after occupancy information has been provided for all the floors. The Clear button should clear all the appropriate controls on the form. The Exit button should end the application. Use the values shown in Figure 5-51 to confirm that your application is performing the correct calculations. Figure 5-51 Completed Hotel Occupancy form

Explanation / Answer

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a(8) As Integer
Dim r(8) As Double
Dim s As Integer = 0
Dim totrate As Double

For i = 1 To 8
a(i) = InputBox("Enter Room Occupied on floor" & i)
s = s + a(i)
r(i) = (a(i) / 30) * 100
ListBox1.Items.Add("Floor " & i & "Rooms occupied " & a(i) & " Occupancy Rate " & r(i))

Next
TextBox1.Text = s
TextBox2.Text = s * 100 / 240
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox1.Items.Clear()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
End Class

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote