Monday, 4 April 2016

Lab 5:Write a Visual Basic Program for Employee details

Private Sub Command1_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Text6.Text = " "
Text7.Text = " "
Text8.Text = " "
Text9.Text = " "
End Sub

Private Sub Command2_Click()
Dim BP As Integer
Dim DA As Integer
Dim HRA As Integer
Dim GS As Integer
Dim NS As Integer
Dim DED As Integer
BP = Val(Text4.Text)
Select Case BP
Case 0 To 2000
DA = 2 / 100 * BP
HRA = 3 / 100 * BP
DED = 500
Text5.Text = DA
Text6.Text = HRA
Text7.Text = DED

Case 2001 To 5000
DA = 4 / 100 * BP
HRA = 3 / 100 * BP
DED = 1000
Text5.Text = DA
Text6.Text = HRA
Text7.Text = DED

Case 5001 To 10000
DA = 6 / 100 * BP
HRA = 7 / 100 * BP
DED = 1500
Text5.Text = DA
Text6.Text = HRA
Text7.Text = DED

Case Is > 10000
DA = 8 / 100 * BP
HRA = 9 / 100 * BP
DED = 2000
Text5.Text = DA
Text6.Text = HRA
Text7.Text = DED
End Select

Text8.Text = Val(Text5.Text) + Val(Text6.Text) + Val(Text4.Text)
Text9.Text = Val(Text8.Text) - Val(Text7.Text)
End Sub

Private Sub Command3_Click()
Unload Me

End Sub

No comments:

Post a Comment