VISUAL BASIC 2010 Create an application that calculates the registration fees fo
ID: 3648477 • Letter: V
Question
VISUAL BASIC 2010
Create an application that calculates the registration fees for a conference. The general conferenceregistration fee is $895 per person. There is also an optional opening night dinner with a keynote address for $30 per person. Additionally, the optional preconference workshops listed are available:
Optional Preconference workshops
Workshop
Introduction to E-commerce $295
The Future of the Web$295
Advance Visual Basic$395
Network Security $395
This application should have two forms.
The Conference Options form allows the user to select the regular conference registration, the optional opening night dinner, and an optional preconference workshop. (The user cannot register for the optional events, however, without selecting the conference registration of $895.). When the Close button is clicked, this form should be remove from the screen and the total registration fee should appear on the main form.
This is what I came up with! The calculations is not showing up when enter. My form are showing up. Can somebody please tell me how to correct this in visual basic 2010.
Public Class ConferenceRegistrationForm
Private Sub btnSelectConferenceOptions_Click(sender As System.Object, e As System.EventArgs) Handles btnSelectConferenceOptions.Click
'To open options.
Dim frmConferenceOptions As New Conference_Options
frmConferenceOptions.Visible =
True
End Sub
Private Sub btnReset_Click(sender As System.Object, e As System.EventArgs) Handles btnReset.Click
'Clearing all textboxes
txtName.Clear()
txtCompany.Clear()
txtAddress.Clear()
txtCity.Clear()
txtPhone.Clear()
txtEmail.Clear()
txtState.Clear()
txtZip.Clear()
lblTotal.Text =
String.Empty
'Reset the Focus.
txtName.Focus()
End Sub
?
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
'To close the current form
Me.Close()
End Sub
End Class
Public
Class Conference_Options
Private Sub btnReset_Click(sender As System.Object, e As System.EventArgs) Handles btnReset.Click
'To clear the checkboxes
chkRegistration.Checked =
False
chkNightDinner.Checked =
False
End Sub
?
Private Sub btnClose_Click(sender As System.Object, e As System.EventArgs) Handles btnClose.Click
Dim total As Integer 'Calculate total
total = 0
If chkRegistration.Checked = True Then
total = total + 895
'Adding registration fee
If chkNightDinner.Checked = True Then
total = total + 30
'Night Dinner
End If
If lstSelect.SelectedIndex <> -1 Then 'checking any list item is selected or not
If lstSelect.SelectedIndex = 0 Then
total = total + 295
Else
total = total + 395
End If
End If
End If
ConferenceRegistrationForm.lblTotal.Text = total.ToString()
Me.Close()
End Sub
Private Sub chkRegistration_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkRegistration.CheckedChanged
If chkRegistration.Checked = True Then
chkNightDinner.Enabled =
True
lstSelect.Enabled =
True
Else
chkNightDinner.Enabled =
False
lstSelect.Enabled =
False
End If
End Sub
?
End Class
Explanation / Answer
Public Class frmOptions 02 03 Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click 04 chkConference.Checked = False 05 chkOpening.Checked = False 06 lstSelect.SelectedIndex = -1 07 End Sub 08 09 Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click 10 Dim conferencecost As Integer 11 Dim subtotal As Integer 12 Dim basecost As Integer 13 Dim opt1cost As Integer 14 Dim opt2cost As Integer 15 Dim opt3cost As Integer 16 basecost = 895 17 opt1cost = 30 18 opt2cost = 295 19 opt3cost = 395 20 If lstSelect.SelectedIndex = 0 Then 21 subtotal = opt2cost 22 ElseIf lstSelect.SelectedIndex = 1 Then 23 subtotal = opt2cost 24 ElseIf lstSelect.SelectedIndex = 2 Then 25 subtotal = opt3cost 26 ElseIf lstSelect.SelectedIndex = 3 Then 27 subtotal = opt3cost 28 End If 29 If chkOpening.Checked = True Then 30 conferencecost = opt1cost + subtotal + basecost 31 Else 32 conferencecost = subtotal + basecost 33 End If 34 If lstSelect.SelectedIndex = -1 Then 35 frmMain.lblPreconferenceWorkshop.Text = "None Selected" 36 Else 37 frmMain.lblPreconferenceWorkshop.Text = CStr(lstSelect.SelectedItem) 38 End If 39 frmMain.lblTotal.Text = CStr(conferencecost) 40 Me.Hide() 41 frmMain.Show() 42 frmMain.BringToFront() 43 End Sub 44 45 End Class
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.