I have to create an app that computes the amount income tax that a person has to pay, depending on salary. Income tax should be calculated for each portion of income in each range. Here are the following income ranges and taxe rates:
Not over $7825=10%income tax
$7825-31852 = 15%income tax
$31851-77100 = 25%income tax
$77101-160850 =28%income tax
$160850-349700=33%income tax
Over $349700 =35%income tax
Here is the code so far:
Public Class IncomeTaxForm
Private Sub calculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calculateButton.Click
Dim IncomeTax As Double = 0
Dim salary As Double = 0
Select Case IncomeTax
Case Is <= 7825
taxResultLabel.Text = (salary * 0.1)
Case 7826 To 31850
taxResultLabel.Text = ((salary - 7826) * 0.15)
Case 31851 To 77100
taxResultLabel.Text = ((salary - 31851) * 0.25)
Case 77101 To 160850
taxResultLabel.Text = ((salary - 77101) * 0.28)
Case 160850 To 349700
taxResultLabel.Text = ((salary - 160850) * 0.33)
Case Is > 349700
taxResultLabel.Text = ((salary - 349700) * 0.35)
End Select
taxResultLabel.Text = String.Format("{0:C}", salary)
I keep getting zeros. Do i have to add another equation for each case?