1.10

4a

Dim hw As Integer

Dim empid As String

Dim hr, gp, np, taxrate, taxamt As Single

empid = InputBox("Enter Employee ID")

While empid <> ""

hw = InputBox("Enter Hours Worked")

hr = InputBox("Enter Hourly Rate")

gp = hw * hr

If gp > 500 Then

taxrate = 0.3

ElseIf gp > 200 Then

taxrate = 0.2

Else

taxrate = 0.1

End If

taxamt = gp * taxrate

np = gp - taxamt

MsgBox("Employee ID is " & empid)

MsgBox("Hours Worked is " & hw)

MsgBox("Hourly Rate is $" & hr)

MsgBox("Gross Pay is $" & gp)

MsgBox("Tax Rate is " & taxrate)

MsgBox("Tax Amounts are $" & taxamt)

MsgBox("Net Pay are $" & np)

empid = InputBox("Enter Employee ID")

End While

--------------------------------------------------------------------------------------------------------------------

4b

1)

Dim hw, ms As Integer

Dim empid As String

Dim hr, gp, np, taxrate, taxamt As Single

empid = InputBox("Enter Employee ID")

While empid <> ""

hw = InputBox("Enter Hours Worked")

hr = InputBox("Enter Hourly Rate")

ms = InputBox("Select Marital Status: Single=1, Married=2, Head of Household=3")

taxrate = InputBox("Enter Taxrate")

If ms = 1 Then

taxrate = taxrate + 0.05

ElseIf ms = 3 Then

taxrate = taxrate - 0.05

ElseIf ms = 1 Then

taxrate = taxrate

Else

MsgBox("Plese Select Correct Marital Status")

End If

gp = hw * hr

taxamt = gp * taxrate

np = gp - taxamt

MsgBox("Employee ID is " & empid)

MsgBox("Hours Worked is " & hw)

MsgBox("Hourly Rate is $" & hr)

MsgBox("Gross Pay is $" & gp)

MsgBox("Tax Rate is " & taxrate)

MsgBox("Tax Amounts are $" & taxamt)

MsgBox("Net Pay are $" & np)

empid = InputBox("Enter Employee ID")

End While

--------------------------------------------------------------------

2)

Dim hw As Integer

Dim ms As Char

Dim empid As String

Dim hr, gp, np, taxrate, taxamt As Single

empid = InputBox("Enter Employee ID")

While empid <> ""

hw = InputBox("Enter Hours Worked")

hr = InputBox("Enter Hourly Rate")

ms = InputBox("Select Marital Status: Single=S, Married=M, Head of Household=H")

taxrate = InputBox("Enter Taxrate")

If ms = "S" Then

taxrate = taxrate + 0.05

ElseIf ms = "H" Then

taxrate = taxrate - 0.05

ElseIf ms = "M" Then

taxrate = taxrate

Else

MsgBox("Plese Select Correct Marital Status")

End If

gp = hw * hr

taxamt = gp * taxrate

np = gp - taxamt

MsgBox("Employee ID is " & empid)

MsgBox("Hours Worked is " & hw)

MsgBox("Hourly Rate is $" & hr)

MsgBox("Gross Pay is $" & gp)

MsgBox("Tax Rate is " & taxrate)

MsgBox("Tax Amounts are $" & taxamt)

MsgBox("Net Pay are $" & np)

empid = InputBox("Enter Employee ID")

End While

----------------------------------------------

3)

Dim hw As Integer

Dim ms As Char

Dim empid As String

Dim hr, gp, np, taxrate, taxamt As Single

empid = InputBox("Enter Employee ID")

While empid <> ""

hw = InputBox("Enter Hours Worked")

hr = InputBox("Enter Hourly Rate")

ms = InputBox("Select Marital Status: Single=S, Married=M, Head of Household=H")

taxrate = InputBox("Enter Taxrate")

If ms = "S" Or ms = "s" Then

taxrate = taxrate + 0.05

ElseIf ms = "H" Or ms = "h" Then

taxrate = taxrate - 0.05

ElseIf ms = "M" Or ms = "m" Then

taxrate = taxrate

Else

MsgBox("Plese Select Correct Marital Status")

End If

gp = hw * hr

taxamt = gp * taxrate

np = gp - taxamt

MsgBox("Employee ID is " & empid)

MsgBox("Hours Worked is " & hw)

MsgBox("Hourly Rate is $" & hr)

MsgBox("Gross Pay is $" & gp)

MsgBox("Tax Rate is " & taxrate)

MsgBox("Tax Amounts are $" & taxamt)

MsgBox("Net Pay are $" & np)

empid = InputBox("Enter Employee ID")

End While

 

4)

Dim hw As Integer

Dim empid As String

Dim hr, gp, np, taxrate, taxamt As Single

empid = TextBox1.Text

hw = TextBox2.Text

hr = TextBox3.Text

gp = hw * hr

If gp > 500 Then

taxrate = 0.3

ElseIf gp > 200 Then

taxrate = 0.2

Else

taxrate = 0.1

End If

If RadioButton1.Checked Then

taxrate = taxrate + 0.05

ElseIf RadioButton3.Checked Then

taxrate = taxrate - 0.05

End If

taxamt = gp * taxrate

np = gp - taxamt

TextBox4.Text = FormatCurrency(gp)

TextBox5.Text = FormatCurrency(taxrate)

TextBox6.Text = FormatCurrency(taxamt)

TextBox7.Text = FormatCurrency(np)

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

4c

Dim hw As Integer

Dim empid As String

Dim hr, overtime, overpay, gp, np, taxrate, taxamt As Single

empid = InputBox("Enter Employee ID")

While empid <> ""

hw = InputBox("Enter Hours Worked")

hr = InputBox("Enter Hourly Rate")

taxrate = InputBox("Enter Taxrate")

If hw > 40 Then

overtime = hw - 40

overpay = overtime * hr * 1.5

Else

overpay = 0

End If

gp = hw * hr + overpay

taxamt = gp * taxrate

np = gp - taxamt

MsgBox("Employee ID is " & empid)

MsgBox("Hours Worked is " & hw)

MsgBox("Hourly Rate is $" & hr)

MsgBox("Overtime Pay is $" & overpay)

MsgBox("Gross Pay is $" & gp)

MsgBox("Tax Rate is " & taxrate)

MsgBox("Tax Amounts are $" & taxamt)

MsgBox("Net Pay are $" & np)

empid = InputBox("Enter Employee ID")

End While

 

 

 

 

Hosted by www.Geocities.ws

1