Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I having difficulties in modifying this payroll solution so that it pays the employee time and one-half for any hours worked over 40. My solution

I having difficulties in modifying this payroll solution so that it pays the employee time and one-half for any hours worked over 40. My solution is below. I need the formula for the time and one-half pay in excess of 40.

Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() ' closes and exit the application

End Sub

Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click 'to calculate and display sun project employee's gross pay, taxes, and net pay

'to declare named constants

Const decFWT_RATE As Decimal = 0.2 Const decFICA_RATE As Decimal = 0.08 Const decSTATE_RATE As Decimal = 0.02

'to declare variables

Dim decHours As Decimal Dim decPayRate As Decimal Dim decGross As Decimal Dim decFwt As Decimal Dim decFica As Decimal Dim decState As Decimal Dim decNet As Decimal

'assign input values into the variables

Decimal.TryParse(txtHours.Text, decHours)

Decimal.TryParse(txtRate.Text, decPayRate)

'to fix the penny off error

decGross = Math.Round(decHours * decPayRate, 2) decFwt = Math.Round(decGross * decFWT_RATE, 2) decFica = Math.Round(decGross * decFICA_RATE, 2) decState = Math.Round(decGross * decSTATE_RATE, 2)

decNet = decGross - decFwt - decFica - decState

'format the gross and taxes outputs into two decimal places

lblGross.Text = decGross.ToString("N2") lblFWT.Text = decFwt.ToString("N2") lblFICA.Text = decFica.ToString("N2") lblState.Text = decState.ToString("N2")

'format the net pay output into usd currency and two decimal places

lblNet.Text = decNet.ToString("C2") End Sub

Private Sub Label4_Click(sender As Object, e As EventArgs) Handles Label4.Click

End Sub End Class

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

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

What is the meaning of fiduciary obligation?

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago