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
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