The submission listed under this question will not compile. A university has the
ID: 3620283 • Letter: T
Question
The submission listed under this question will not compile.A university has the following dormitories:
Allen Hall: $1500 per customer
Pike Hall: $1600 per semester
Farthing Hall: $1200 per semester
University Suites: $1800 per semester
The university also offers the following meal plans:
7 meals per week: $560 per semester
14 meals per week: $1095 per semester
unlimited meals: $1500 per semester
Create an application with two combo boxes. One should hold the names of the dormitories, and the other should hold the meal plans. The user should select a dormitory and a meal plan, and the application should show the total charges for the semester.
Explanation / Answer
Public Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click Dim AllenHall As Integer = 1500 Dim PikeHall As Integer = 1600 Dim FathingHall As Integer = 1200 Dim UniversitySuites As Integer = 180 Dim dormResults As Integer If ListBox1.SelectedIndex = -1 Then MessageBox.Show("Select a Meal Plan!") End If If ListBox1.SelectedIndex = 0 Then lblDormCost.Text = AllenHall.ToString dormResults = AllenHall ElseIf ListBox1.SelectedIndex = 1 Then lblDormCost.Text = PikeHall.ToString dormResults = PikeHall ElseIf ListBox1.SelectedIndex = 2 Then lblDormCost.Text = FathingHall.ToString dormResults = FarthingHall ElseIf ListBox1.SelectedIndex = 3 Then lblDormCost.Text = UniversitySuites.ToString dormResults = UniversitySuites End If
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.