1.10
4a
Dim hw As Integer Dim empid As String Dim hr, gp, np, taxrate, taxamt As Singleempid = InputBox("Enter Employee ID")
While empid <> ""hw = InputBox("Enter Hours Worked")
hr = InputBox("Enter Hourly Rate")
gp = hw * hr
If gp > 500 Thentaxrate = 0.3
ElseIf gp > 200 Thentaxrate = 0.2
Elsetaxrate = 0.1
End Iftaxamt = 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 Singleempid = 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 Thentaxrate = taxrate + 0.05
ElseIf ms = 3 Thentaxrate = taxrate - 0.05
ElseIf ms = 1 Thentaxrate = taxrate
ElseMsgBox("Plese Select Correct Marital Status")
End Ifgp = 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 Singleempid = 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" Thentaxrate = taxrate + 0.05
ElseIf ms = "H" Thentaxrate = taxrate - 0.05
ElseIf ms = "M" Thentaxrate = taxrate
ElseMsgBox("Plese Select Correct Marital Status")
End Ifgp = 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 Singleempid = 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" Thentaxrate = taxrate + 0.05
ElseIf ms = "H" Or ms = "h" Thentaxrate = taxrate - 0.05
ElseIf ms = "M" Or ms = "m" Thentaxrate = taxrate
ElseMsgBox("Plese Select Correct Marital Status")
End Ifgp = 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 Singleempid = TextBox1.Text
hw = TextBox2.Text
hr = TextBox3.Text
gp = hw * hr
If gp > 500 Thentaxrate = 0.3
ElseIf gp > 200 Thentaxrate = 0.2
Elsetaxrate = 0.1
End If If RadioButton1.Checked Thentaxrate = taxrate + 0.05
ElseIf RadioButton3.Checked Thentaxrate = taxrate - 0.05
End Iftaxamt = 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 Singleempid = InputBox("Enter Employee ID")
While empid <> ""hw = InputBox("Enter Hours Worked")
hr = InputBox("Enter Hourly Rate")
taxrate = InputBox("Enter Taxrate")
If hw > 40 Thenovertime = hw - 40
overpay = overtime * hr * 1.5
Elseoverpay = 0
End Ifgp = 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