Create a VB program to calculate the income tax.User will put his Annual Income in the box and by clicking on "Income Tax" button, message box will show his income tax according to the following rule :
Refer Pay Slip of an Employee , Calculate the Gross & Net Salary of an Employee also
Rs | Tax |
0 – 50,000 | No Tax |
50,000 – 60,000 | 10% of Annual Income |
60,000 – 1,50,000 | 20% of Annual Income |
More than 1,50,000 | 30% of Annual Income |
Refer Pay Slip of an Employee , Calculate the Gross & Net Salary of an Employee also
(A)Program Design :
(B) Property(Controls Used) :
- 2 Labels
- TextBox (Text1-To get Annual Income from the user)
- One Command Button
- TextBox (Text2-To show the Income Tax)
(C) Attaching Code to the Object :
Private Sub Command1_Click() Dim AI As Double AI = Val(Text1) If AI > 0 And AI < 50000 Then Text2 = "No Tax" Else If AI > 50000 And AI < 60000 Then Text2 = AI * 0.1 Else If AI > 60000 And AI < 150000 Then Text2 = AI * 0.2 Else If AI > 150000 Then Text2 = AI * 0.3 End If End If End If End If End Sub |
(D) Output :
(E) Errors :
If found any errors while running your VB program, please click this link Possible Errors while running VB Programs to get a solution.
3 comments:
This is not how the tax code works though. On all income the first 50000 would not be taxed, the next dollars above 50K but less than 60K would be taxed .1 and then 60000 And amts < 150000 at 0.2, then amounts over 150k at 0.3 At least that's how it is in the U.S.
The Tax calculated here is according to the question given :
The importance is how to attach the proper code for the given scale .
Anyway , thanks for correcting ..
Than you for Upload the program .
Very useful to develop Private software in Visual Basic.
Thanx & Regards .
From:-
Gulam Ishani
Post a Comment