0% found this document useful (0 votes)
19 views2 pages

Select Case - Netsalary Possible Solution

Uploaded by

mwisilwandile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

Select Case - Netsalary Possible Solution

Uploaded by

mwisilwandile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Public Class Form1

Dim HourlyRate, Tax, Gross, Netsalary, DayRate As Double


Dim Name As String

Private Sub btnCheckNetsalary_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnCheckNetsalary.Click
HourlyRate = txthourlyRate.Text
Name = txtName.Text

DayRate = HourlyRate * 7
Gross = DayRate * 25.67

Select Case Gross

Case 8000 To 17999


Tax = Gross * 0.12
Netsalary = Gross - Tax
MessageBox.Show("Net Salary for " & Name & " is R" & Netsalary,
"Salary Advice")

Case 18000 To 29999


Tax = Gross * 0.18
Netsalary = Gross - Tax
MessageBox.Show("Net Salary for " & Name & " is R" & Netsalary,
"Salary Advice")

Case 30000 To 58000


Tax = Gross * 0.25
Netsalary = Gross - Tax
MessageBox.Show("Net Salary for " & Name & " is R" & Netsalary,
"Salary Advice")
End Select

End Sub
Private Sub btnCheckTax_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCheckTax.Click
HourlyRate = txthourlyRate.Text
Name = txtName.Text

DayRate = HourlyRate * 7
Gross = DayRate * 25.67

Select Case Gross


Case 8000 To 17999
MessageBox.Show("Tax is 12% for " & Name, "Tax Advice")

Case 18000 To 29999


MessageBox.Show("Tax is 18% for " & Name, "Tax Advice")

Case 30000 To 58000


MessageBox.Show("Tax is 25% for " & Name, "Tax Advice")
End Select
End Sub

Private Sub txtTaxAmount_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtTaxAmount.Click
HourlyRate = txthourlyRate.Text
Name = txtName.Text

DayRate = HourlyRate * 7
Gross = DayRate * 25.67

Select Case Gross

Case 8000 To 17999


Tax = Gross * 0.12
MessageBox.Show("Tax Amount for " & Name & " is R" & Tax, "Tax
Advice")

Case 18000 To 29999


Tax = Gross * 0.18
MessageBox.Show("Tax Amount for " & Name & " is R" & Tax, "Tax
Advice")

Case 30000 To 58000


Tax = Gross * 0.25
MessageBox.Show("Tax Amount for " & Name & " is R" & Tax, "Tax
Advice")

End Select
End Sub
End Class

You might also like