CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    6

    Smile Payroll program?

    I just wanted to know are my calculations correct?
    the Fedtax is 0.06
    and the stateTax is .33

    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
    Dim PayRate As Double 'Employee's payrate
    Dim Hours As Double 'Hours worked by employee
    Dim StateTax As Double 'State deductions for employee
    Dim FedTax As Double 'Federal deductions for employee
    Dim GrossPay As Double 'Total Grosspay for employee
    Dim NetPay As Double 'Total Netpay for employee



    'Convert payrate to double
    PayRate = Convert.ToDouble(Me.txtPayRate.Text)

    'Convert hours to double
    Hours = CDbl(Me.txtHours.Text)

    'Convert statetax to double
    FedTax = Convert.ToDouble(Me.txtFedTax.Text)

    'Convert fedtax to double
    StateTax = CDbl(Me.txtStateTax.Text)

    'Determine pay
    GrossPay = PayRate * Hours
    NetPay = GrossPay * FedTax
    NetPay = GrossPay * StateTax
    NetPay = GrossPay - FedTax
    NetPay = GrossPay - StateTax

    'Display pay
    Me.lblGrossPay.Text = Convert.ToString(GrossPay)
    Me.lblNetPay.Text = Convert.ToString(NetPay)

    End Sub
    End Class

  2. #2
    Join Date
    Dec 2004
    Posts
    5

    Re: Payroll program?

    IS there any overtime worked at the company? If so you will need to include that also.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured