Explanation of Solution
Program
Public Class frmMain
'Declaring variables of type double and initializing with values
'variable twin
Dim twin As Double = 39.99
'variable full
Dim full As Double = 49.99
'variable queen
Dim queen As Double = 49.99
'variable king
Dim king As Double = 69.99
'variable totalCost
Dim totalCost As Double = 0
'variable shippingFee
Dim shippingFee As Double
'calculating total cost after clicking on button
Private Sub btnCost_Click(sender As Object, e As EventArgs) Handles btnCost.Click
'displaying total cost in textbox and Math.Round() is used to round the totalcost to two decimal places
txtCost.Text = String.Format("$" + Math.Round((totalCost + shippingFee), 2).ToString())
End Sub
'exit button click
Private Sub btnExit_Click (sender As Object, e As EventArgs) Handles btnExit.Click
Application.Exit()
End Sub
'checkbox CheckedChanged() event
Private Sub chkpickup_CheckedChanged(sender As Object, e As EventArgs) Handles chkpickup.CheckedChanged
'if checkbox is checked then
If (chkpickup.Checked = True) Then
'assign the shipping fee to the variable shippingFee
shippingFee = 5
Else
'else shippingFee is zero
shippingFee = 0
End If
End Sub
'radio button twin CheckedChanged() event
Private Sub rbtTwin_CheckedChanged(sender As Object, e As EventArgs) Handles rbtTwin.CheckedChanged
'if radio button is changed the clear values from textbox
txtCost.Text = ""
If (rbtTwin...
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Programming with Microsoft Visual Basic 2017
- This is for Visual Basic I and is not in a textbook. Create a Windows Form application. Use the following names for the project and solution, respectively: NFL Teams Project and NFL Teams Solution. Add any 6 NFL teams to a list box. When the user clicks a team in the list box, the list box’s SelectedIndexChanged procedure should display the State that the NFL Team is from in a label control. Example "Altanta Falcons" display Georgia, in the label. Look back at Chapter 5 for examples of list boxes. I need some help understanding it. My teacher gave this to me as a example question.arrow_forwardWhen you drag a field object to an existing control in the interface, Visual Basic replaces the existing control with a new control.a. True b. Falsearrow_forwardPearson Charity: Donation Form Please complete the form. Mandatory fields are marked with a * PERSONAL INFORMATION DETAILS- For example: John Doe For example: 012-345-6789 For example:user@domain.com Select an option Name * Phone* Email * Gender* DONATION DETAILS Amount* Fund* Donate Any amount between R1 - R1000 Select an optionarrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning