Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PROGRAMMING using visual studio C# User-defined functions. a) Use Test1PizzaCalc

ID: 3598496 • Letter: P

Question

PROGRAMMING using visual studio C#

User-defined functions.

a) Use Test1PizzaCalc project file.

b) Complete functions calculatesubTotal(), calculateTax(), calculateTotal(), and displayValues() function

Subtotal = [size selection] plus [total of topping selections] plus [total of sauce selections] plus [take-out/delivery charge] minus discount [see below]

If coupon code is A101, discount is 10%

If coupon code is B202, discount is 15%

If coupon code is C303, discount is 20%

Tax = Subtotal times 8.25%

Total = Subtotal + Tax

c) Display outputs to textboxes

Explanation / Answer

If Not IsNumeric(txtIncome.Text) Then
MessageBox.Show("Please enter income", "Error")
End If
Dim income As Double = CDbl(txtIncome.Text)
Dim liabilityTax, taxBracket, percentTax As Double

Select Case income
Case CDbl((income) <= 8700)
liabilityTax = (income * 0.1)
taxBracket = (0)
percentTax = (liabilityTax) / income

Case CDbl(income <= 35350)
liabilityTax = (870 + (0.15 * (income - 8700)))
taxBracket = 15
percentTax = (liabilityTax) / income

Case CDbl(income <= 85650)
liabilityTax = (4867.5 + (0.25 * (income - 35350)))
taxBracket = 28
percentTax = (liabilityTax) / income

Case CDbl(income <= 178650)
liabilityTax = (17442.5 + (0.28 * (income - 85650)))
taxBracket = 33
percentTax = (liabilityTax) / income

Case CDbl(income <= 388350)
liabilityTax = (43482.5 + (0.33 * (income - 178650)))
taxBracket = 35
percentTax = (liabilityTax) / income

Case CDbl(income > 388350)
liabilityTax = (112683.5 + (0.35 * (income - 388350)))
taxBracket = 38
percentTax = (liabilityTax) / income

End Select
txtLiability.Text = FormatCurrency(liabilityTax)
txtBracket.Text = FormatPercent(taxBracket)
txtPercent.Text = FormatCurrency(percentTax)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote