In this exercise, you modify one of the Seminars applications from Chapter 4’s Apply lesson. Open the Seminars Solution.sln file contained in the Seminars Solution-CheckBox folder. Create an event-handling Sub procedure named ClearAmountDue and associate it with each check box’s CheckChanged event. Then, create a function that determines which (if any) check boxes are selected and then adds the associated fee to the total due. The function should return the total due to the statement that invoked it. Also, make the necessary modifications to the btnCalc_Click procedure’s code. Save the solution and then start and test the application. In VB please.   Code Given:  Option Explicit On Option Strict On Option Infer Off Public Class frmMain Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' Calculate and display the amount due. Dim intAmountDue As Integer ' Determine which (if any) check boxes are selected ' and add the associated fee to the amount due. If chkFinance.Checked = True Then intAmountDue = intAmountDue + 150 End If If chkHealth.Checked = True Then intAmountDue = intAmountDue + 125 End If If chkMarketing.Checked = True Then intAmountDue = intAmountDue + 135 End If lblAmountDue.Text = intAmountDue.ToString("C0") End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub chkFinance_CheckedChanged(sender As Object, e As EventArgs) Handles chkFinance.CheckedChanged lblAmountDue.Text = String.Empty End Sub Private Sub chkHealth_CheckedChanged(sender As Object, e As EventArgs) Handles chkHealth.CheckedChanged lblAmountDue.Text = String.Empty End Sub Private Sub chkMarketing_CheckedChanged(sender As Object, e As EventArgs) Handles chkMarketing.CheckedChanged lblAmountDue.Text = String.Empty End Sub Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub End Class

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter6: Sub And Function Procedures
Section: Chapter Questions
Problem 5E
icon
Related questions
Question

In this exercise, you modify one of the Seminars applications from Chapter 4’s Apply lesson. Open the Seminars Solution.sln file contained in the Seminars Solution-CheckBox folder. Create an event-handling Sub procedure named ClearAmountDue and associate it with each check box’s CheckChanged event. Then, create a function that determines which (if any) check boxes are selected and then adds the associated fee to the total due. The function should return the total due to the statement that invoked it. Also, make the necessary modifications to the btnCalc_Click procedure’s code. Save the solution and then start and test the application. In VB please.

 

Code Given: 

Option Explicit On
Option Strict On
Option Infer Off

Public Class frmMain

Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click
' Calculate and display the amount due.

Dim intAmountDue As Integer

' Determine which (if any) check boxes are selected
' and add the associated fee to the amount due.
If chkFinance.Checked = True Then
intAmountDue = intAmountDue + 150
End If

If chkHealth.Checked = True Then
intAmountDue = intAmountDue + 125
End If

If chkMarketing.Checked = True Then
intAmountDue = intAmountDue + 135
End If

lblAmountDue.Text = intAmountDue.ToString("C0")
End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()
End Sub

Private Sub chkFinance_CheckedChanged(sender As Object, e As EventArgs) Handles chkFinance.CheckedChanged
lblAmountDue.Text = String.Empty

End Sub

Private Sub chkHealth_CheckedChanged(sender As Object, e As EventArgs) Handles chkHealth.CheckedChanged
lblAmountDue.Text = String.Empty

End Sub

Private Sub chkMarketing_CheckedChanged(sender As Object, e As EventArgs) Handles chkMarketing.CheckedChanged
lblAmountDue.Text = String.Empty

End Sub

Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub
End Class

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Knowledge Booster
Data Binding
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning