answersLogoWhite

0


Best Answer

Private Sub ClearLabels()

' clears the contents from the labels that display subtotal, tax, and total due

lblSubtotal.Text = String.Empty

lblSalesTax.Text = String.Empty

lblTotal.Text = String.Empty

End Sub

Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click

' displays the cost of doughnuts and coffee

Dim decSubtotal As Decimal

Dim decSalesTax As Decimal

Dim decTaxRate As Decimal = 0.03

Dim decTotal As Decimal

'calculates the cost of doughnuts

If radGlazed.Checked Then

decSubtotal += 0.65

ElseIf radSugar.Checked Then

decSubtotal += 0.65

ElseIf radChocolate.Checked Then

decSubtotal += 0.85

ElseIf radFilled.Checked Then

decSubtotal += 1.0

End If

' calculates the cost of coffee

If radNone.Checked = True Then

' do nothing

ElseIf radRegular.Checked = True Then

decSubtotal += 1.8

ElseIf radCappuccino.Checked = True Then

decSubtotal += 2.5

End If

' calculate the sales tax

decSalesTax = decTaxRate * decSubtotal

' calculates the price of a doughnut and coffee

lblSubtotal.Text = decSubtotal.ToString("C2")

lblSalesTax.Text = decSalesTax.ToString("C2")

lblTotal.Text = decTotal.ToString("C2")

End Sub

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Does anyone have a code for a VB donut Shoppe project?
Write your answer...
Submit
Still have questions?
magnify glass
imp