Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Monday, July 18, 2011

VB-47 : Calculate the Gross & Net Salary of an Employee

Design a VB application to take input the Employee's Name,Employee No,Basic Salary,HRA,DA,City Allowance and Deductions.Calculate the Gross & Net Salary.

  • Gross Salary=Basic+HRA+DA+City Allowance-Professional Tax
  • Net Salary=Gross Salary-P.F


A)    Program Design :


(B) Property(Controls Used) :
  •      11 Labels
  •      10 Text Boxes (The Index Property of the 1st 6 text boxes should be from 0 to 5 respectively,,,Text Property of text boxes for entering Employee name & number should be kept as blank and all others are Zero,,,The Locked Property of the text boxes (For calculating Gross & Net Salary) should be kept as True
  •      One Command Button (Caption is Calculate)

(C) Attaching Code to the Object :

Private Sub Command1_Click()
Dim sum As Integer
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "Enter Employee Number and Name"
End If

For i = 2 To 5
sum = sum + Val(Text1(i).Text)
Next
sum = sum - Val(Text7.Text)
Text9 = sum
Text10 = sum - Val(Text8.Text)
End Sub                                                                                                            


Possible Error  :Method or Data Member not Found
====================================================================
=========================================================


No comments: