enjoi888
Forum Addict

ok my teacher gave us this program to make
basically he wants us to make a calc that calculates a persons pay based on hours worked, overtime worked, and pay rate and its supposed to calculate the persons pay after their overtime pay is included and then calculate how much tax will b taken out( fed tax=10% state tax =5%) and then their take-home pay after taxs have been taken out and overtime has been added in
i got everything working fine except wen i started working on the taxs part, i guess i might b having trouble with using const's or something
it keeps saying argument expression cant b done or watever
heres my code and pls help fast
basically he wants us to make a calc that calculates a persons pay based on hours worked, overtime worked, and pay rate and its supposed to calculate the persons pay after their overtime pay is included and then calculate how much tax will b taken out( fed tax=10% state tax =5%) and then their take-home pay after taxs have been taken out and overtime has been added in
i got everything working fine except wen i started working on the taxs part, i guess i might b having trouble with using const's or something
it keeps saying argument expression cant b done or watever
heres my code and pls help fast
Code:
'Kevin Galloway September 31,2008
Option Explicit On
Public Class Form1
Private Sub xExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xExitButton.Click
Me.Close()
End Sub
Private Sub xResetButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xResetButton.Click
Me.xRegHourTextbox.Text = String.Empty
Me.xOverHourTextbox.Text = String.Empty
Me.xPayRateTextbox.Text = String.Empty
Me.xRegPayTextbox.Text = String.Empty
Me.xOverPayTextbox.Text = String.Empty
Me.xGrossPayTextbox.Text = String.Empty
Me.xFedTaxTextbox.Text = String.Empty
Me.xStateTaxTextbox.Text = String.Empty
Me.xNetPayTextbox.Text = String.Empty
Me.xStateTaxRate.text = String.Empty
Me.xFedTaxRate.text = String.Empty
End Sub
Private Sub xCalculateButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xCalculateButton.Click
Const xFedTaxRate As Decimal = 0.1D
Const xStateTaxRate As Decimal = 0.05D
Dim xRegHourTextbox As Integer
Dim xOverHourTextbox As Integer
Dim xPayRateTextbox As Integer
Dim xGrossPayTextbox As Integer
Dim xNetPayTextbox As Integer
Dim xRegPayTextbox As Integer
Dim xOverPayTextbox As Decimal
Dim xFedTaxTextbox As Integer
Dim xStateTaxTextbox As Integer
Me.xRegPayTextbox.Text = Val(Me.xRegHourTextbox.Text) * Val(Me.xPayRateTextbox.Text)
Me.xOverPayTextbox.Text = Val(Me.xOverHourTextbox.Text) * Val(Me.xPayRateTextbox.Text) * 1.5
Me.xGrossPayTextbox.Text = Val(Me.xRegPayTextbox.Text) + Val(Me.xOverPayTextbox.Text)
Me.xFedTaxTextbox.Text = Val(Me.xGrossPayTextbox.Text) * Val(Me.xFedTaxRate)
End Sub
End Class

