Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this phase of the payroll system, we are going to include the appropriate tax rate (variable) rather than a fixed tax rate of 10%

In this phase of the payroll system, we are going to include the appropriate tax rate (variable) rather than a fixed tax rate of 10% (constant). The program will also compute the overtime pay.

4A) Assign different tax rates based on the following gross pay:

  • If gross pay is more $1000, the tax rate is 30%
  • If the gross pay is more than $800.00 and less than or equal to $1000.00, then the tax rate is 20%.
  • If the gross pay is more than $500.00 and less than $800.00, then the tax rate is 10%
  • If gross pay is more than or equal to 0 and less than or equal to 500 tax rate is 0.

The tax rate will also vary based on marital status. Add 5% to the tax rate of a single person and subtract 5% if head of household.

Declare marital status as a character: S=Single M=Married H=Head of Household

Program should accept either upper case or lower case letters for marital status (e.g. accept M or m).

4B) Compute the overtime pay according to the following formula:

Any hours over 40 are considered time and a half (overtime). You may want to find overtime hours (e.g. hoursworked 40) and overtime pay (e.g. overtimehours*hourlyrate * 1.5).

What I have so far is posted below, but its not working like it should.

image text in transcribed

#include using namespace std; main() { int hw, empid; floathr, gp, np, taxrate, taxamt; while( cin >> empid >> hw >> hr ) { gp = hw * hr; if( gp > 1000 ) taxrate = 0.30; else if( gp > 800) taxrate = 0.20; else if( gp > 500) taxrate = 0.10; else taxrate = 0.0; taxamt = gp * taxrate; np = gp - taxamt; cout using namespace std; main() { int hw, empid; floathr, gp, np, taxrate, taxamt; while( cin >> empid >> hw >> hr ) { gp = hw * hr; if( gp > 1000 ) taxrate = 0.30; else if( gp > 800) taxrate = 0.20; else if( gp > 500) taxrate = 0.10; else taxrate = 0.0; taxamt = gp * taxrate; np = gp - taxamt; cout

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

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

3. Identify cultural universals in nonverbal communication.

Answered: 1 week ago