Question
INPUT Input the employees name, hourly wage, hours worked, withholding allowances, marital status as M or S, and previous year-to-date earnings. All input is to
INPUT Input the employees name, hourly wage, hours worked, withholding allowances, marital status as M or S, and previous year-to-date earnings. All input is to be carried out in the input function.
CALCULATIONS - There is one main calculation function which calls another function that will compute the FICA tax and the federal income tax.
- Current earnings are computed as hourly wage times hours worked (extra credit if your program pays time-and-a-half after 40 hours).
- Year-to-date earnings need to be updated by adding in current earnings.
- To compute FICA, if year-to-date earnings are less than $128,700, multiply current earnings by 6.2%; if year-to-date earnings greater than or equal to 128,700 there is no FICA tax i.e. 0.00 .
- To compute federal income tax to be withheld, first subtract the product of the withholding allowances times 345.80 from current earnings and compute tax according to chart below:
If the amount of wages (after subtracting withholding allowances) is: | Tax is: | |
Not over $308 . . . . . . . | $0 | |
Over | But not over | |
$308 | $1,102 | $0.00 plus 10% of the amount over 308 |
$1,102 $3,533 $79.40 plus 12% of the amount over 1102
$3,533 | $7,183 | $371.12 plus 22% of the amount over 3533 |
$7,183 | $13,433 | $1,174.12 plus 24% of the amount over 7183 |
$13,433 | $16,975 | $2,674.12 plus 32% of the amount over 13433 |
$16,975 | $41,975 | $3,807.56 plus 35% of the amount over 16975 |
$41,975 | ............ | $12,557.56 plus 37% of the amount over 41975 |
(b) MARRIED person | ||
If the amount of wages (after subtracting withholding allowances) is: | Tax is: | |
Not over $963 . . . . . . . | $0 | |
Over | But not over | |
$963 | $2,550 | $0.00 plus 10%of amount over 963 |
$2,550 | $7,413 | $158.70 plus 12%of amount over 2550 |
$7,413 | $14,713 | $742.26 plus 22%of amount over 7413 |
$14,713 | $27,213 | $2,348.26 plus 24%of amount over 14713 |
$27,213 | $34,296 | $5,348.26 plus 32%of amount over 27213 |
$34,296 | $50,963 | $7,614.82 plus 35%of amount over 34296 |
$50,963 | ........... | $13,448.27 plus 37%of amount over 50963 |
Amount of check = current earnings FICA tax income tax withheld
OUTPUT Name of employee, current earnings, year-to-date earnings, FICA tax, income tax withheld, and amount of check. Descriptions are left justified and values are output with two digits to the right of the decimal point and decimal points are lined up.
THEME ISSUES Functions, sub-functions, pass by reference Absolutely no global variables permitted
TEST DATA
Name Hourly Wage Hours Worked Withholding Allowances Marital Status Year-to-date earnings
Al Clark 48.50 38 2 M 88,600.00
Karen Chen 44.00 35 3 M 68,200.00
Nathan Chan 25.50 50 1 S 36,295.50
SAMPLE OUTPUT
Al Clark Current Earnings 1843.00 Year-to-date 90443.00 FICA tax 114.27 Income Tax Withheld 18.84 Amount of check 1709.89
CHECKPOINTS 1) Include name, e-mail, and lab# as comments in the code and also include code to output this information to the output.
2) Minimum of three (3) comments (including Pre/Post) in each function of the exactly 4 functions other than main() (see structure chart). A fifth signature function is optional, but no more. Pre comments must identify reference variables, i.e. reference to hourly wages. All functions (other than main() & your signature function) must use prototype style.
3) Use exactly one function separate from main for input.
4) Call a calculation function from main which handles all calculations. This function needs to call a sub-function (another function) to calculate exactly the following and no more: amount of FICA tax and amount of federal income tax withheld.
5) Use exactly one function separate from main for output. Output must be formatted exactly as shown on lab write-up with decimal points lined up.
6) Pass by reference variable is used when needed and only when needed.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started