Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the code so that it pays the employee time and one-half for any hours worked over 40. I need to change the code listed

Modify the code so that it pays the employee time and one-half for any hours worked over 40.

I need to change the code listed below to show what the GrossPay would be if the employee is paid time and one half for any hours worked over 40. For example if employee worked 35.5 hours his net pay is 339.38. If the employee were to work 44 hours the gross pay should equal 439.76 not 420.64.

image text in transcribedimage text in transcribed

image text in transcribed

Sun Projects ... - O X Total Hours Worked: Employee Pay Rate: 35.5 9.56 Calculate Close Gross Pay: $339.38 Federal Taxes: $67.88 FICA Tax: $27.15 State Tax: $6.79 Net Pay: $237.56 Sun Projects ... - O X Total Hours Worked: 44 9.56 Employee Pay Rate: Calculate Close Gross Pay: $420.64 Federal Taxes: $84.13 FICA Tax: $33.65 State Tax: $8.41 Net Pay: $294.45 Edit Help Sun Solution - 0 X File 10. View - Project 1 Build 2 Debug Test Analyze Tools Extensions .8. Debug - Any CPU - Window Start - Search (Ctrl+Q) : EEEEEEER Live Share go frm Main.vb + VE Sun Project Data Sources Toolbox x frm Main.vb [Design] - Frm Main - hours 1 reference Public class Frmain Private Const FWT = 0.2 Private Const FICA = 0.08 Private Const STATE INCOME TAX = 0.02 Dim hours As Double Dim payrate As Double Dim grossPay As Double Dim netPay As Double Dim fwtTax As Double Dim ficaTax As Double Dim stateTax As Double Oreferences Private Sub BtnCalculate_Click(sender As Object, e As EventArgs) Handles BtnCalculate.click If Not Decimal. TryParse(txtHours. Text, hours) Then MessageBox.Show("Please Enter Valid Hours!!!") ElseIf Not Decimal. TryParse(txtPayRate.Text, payrate) Then MessageBox.Show("Please Enter Valid Pay Rate!!!") Else grossPay = Math.round(hours, 2) * Math.round(payrate, 2) futTax = Math. Round(grossPay, 2) Math. Round(FWT, 2) ficaTax = Math. Round (grossPay, 2) * Math. Round (FICA, 2), stateTax = Math. Round (grossPay, 2) * Math.round(STATE_INCOME_TAX, 2), netPay - Math. Round (grossPay, 2) - Math. Round(fwtTax, 2) - Math.round(ficaTax, 2) - Math. Round (stateTax, 2) Label3. Text = ("Gross Pay: ") & grossPay.ToString("C") Label4.Text = ("Federal Taxes: ") & fwtTax.ToString("C") Labe15. Text - ("FICA Tax:") & ficaTax.ToString("C") Labe16. Text = ("State Tax: ") & state Tax.ToString("C") Label7. Text - ("Net Pay: ") & netPay.ToString("C") End If End Sub O references Private Sub Btnclose_Click(sender As Object, e As EventArgs) Handles Btnclose.Click Me.Close() : End Sub End Class Solution Explorer Notifications Properties Property Manager Ln: 5 Ch: 8 SPC 100% . No issues found Error List Output CRLF O Ready Add to Source Control

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions