Question: VISUAL STUDIO IN VISUAL BASIC LANGUAGE *tryparse and varible NOT JAVA SCRIPT OR C LANGUAGE Lemon Motors sells vehicles of dubious quality to debatably discerning
VISUAL STUDIO IN VISUAL BASIC LANGUAGE
*tryparse and varible
NOT JAVA SCRIPT OR C LANGUAGE
Lemon Motors sells vehicles of dubious quality to debatably discerning customers. They've asked you to write an
app that determines sales prices.
Users will type a vehicle price in a text box. In other objects on your screen, users will select if they want:
Rust proofing for $500
Extended warranty for $2000
Pin striping for $250
When the calculate button is clicked, the following results will be displayed:
The total amount of the three add-ons listed above
The random discount, which is anywhere between 0% to 15% of the vehicle price
The subtotal, which is the vehicle price, plus add-ons, minus the discount.
A $300 service fee, which is added to all car sales
The sales tax, which is 10% of the subtotal
The final sale price, which is the subtotal plus tax and service fee.
All results are shown in local currency. All result labels should clear when a change is made to any object that
captures user data.
what am i doing wrong?
Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click 'Clear input content txtVehiclePrice.Text = String.Empty 'Clear results lblDiscount.Text = String.Empty lblAddOn.Text = String.Empty lblSubTotal.Text = String.Empty lblServiceFee.Text = String.Empty lblSalesTax.Text = String.Empty lblFinalPrice.Text = String.Empty 'Reset radio buttons radRustProofing.Checked = False radExtendedWarranty.Checked = False radPinStriping.Checked = False 'Put the cursor in textbox txtVehiclePrice.Focus() End Sub
Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
'Create variables to store input from textboxes Dim dblDiscount As Double Dim intAddOns As Integer Dim intVehicelPrice As Integer Dim dblSubTotal As New Double Dim intServiceFee As Integer Dim dblSalesTax As New Double Dim dblFinalPrice As New Double
'store input in variables Integer.TryParse(txtVehiclePrice.Text, intVehicelPrice)
Const intSRV_FEE As Integer = 300 Const dec_TAX As Decimal = 0.1D
'Apply random discount 0% through 15% Dim rnd As New Random
'Apply addon price If radRustProofing.Checked Then intAddOns = 500 ElseIf radExtendedWarranty.Checked Then intAddOns = 2000 ElseIf radPinStriping.Checked Then intAddOns = 250 End If
End Sub
Private Sub txtVehiclePrice_TextChanged(sender As Object, e As EventArgs) Handles txtVehiclePrice.TextChanged 'Clear results if text change lblDiscount.Text = String.Empty lblAddOn.Text = String.Empty lblSubTotal.Text = String.Empty lblServiceFee.Text = String.Empty lblSalesTax.Text = String.Empty lblFinalPrice.Text = String.Empty End Sub
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
