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.
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
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.