rite a C++ program to calculate a person’s pay stub assuming paid on a monthly basis.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a C++ program to calculate a person’s pay stub assuming paid on a monthly basis.

                                                INPUT                                                      
Input the employee’s 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 (
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 $132,900, multiply current
earnings by 6.2%; if year-to-date earnings greater than or equal to 132,900 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 80.60 from current earnings and compute tax according to
chart below:  (The chart is in the images below)

 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

                                                  CHECKPOINTS                                         

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.

To compute federal income tax to be withheld, first subtract the product of the
withholding allowances times 80.60 from current earnings and compute tax according to
chart below:
|(a) SINGLE person–
If the amount of wages (after
subtracting withholding allowances) Tax is:
is:
Not over $73 .
$0
Over-
But not over-
$73
$260
$832
$1,692
$3,164
$3,998
$9,887
$260
$832
$1,692
$3,164
$3,998 .
$9,887
$0.00 plus 10% of the amount over 73
$18.70 plus 12% of the amount over 260
$87.34 plus 22%of the amount over 832
$276.54 plus 24% of the amount over 1692
$629.82 plus 32% of the amount over 3164
$896.70 plus 35% of the amount over 3998
$2,957.85 plus 37%of the amount over 9887
|(b) MARRIED person–
If the amount of wages (after
subtracting withholding allowances) Tax is:
is:
|Not over $227.
$0
Over-
But not over-
$227
$600
$1,745
$3,465
$6,409
$8,077
$12,003
$0.00 plus 10%of amount over 227
. $37.30 plus 12% of amount over 600
$174.70 plus 22%of amount over 1745
$553.10 plus 24%of amount over 3465
$1,259.66 plus 32%of amount over 6409
$1,793.42 plus 35%of amount over 8077
$3,167.52 plus 37%of amount over 12003
$600
$1,745
$3,465
$6,409
$8,077
$12,003
• Amount of check = current earnings – FICA tax – income tax withheld
Transcribed Image Text:To compute federal income tax to be withheld, first subtract the product of the withholding allowances times 80.60 from current earnings and compute tax according to chart below: |(a) SINGLE person– If the amount of wages (after subtracting withholding allowances) Tax is: is: Not over $73 . $0 Over- But not over- $73 $260 $832 $1,692 $3,164 $3,998 $9,887 $260 $832 $1,692 $3,164 $3,998 . $9,887 $0.00 plus 10% of the amount over 73 $18.70 plus 12% of the amount over 260 $87.34 plus 22%of the amount over 832 $276.54 plus 24% of the amount over 1692 $629.82 plus 32% of the amount over 3164 $896.70 plus 35% of the amount over 3998 $2,957.85 plus 37%of the amount over 9887 |(b) MARRIED person– If the amount of wages (after subtracting withholding allowances) Tax is: is: |Not over $227. $0 Over- But not over- $227 $600 $1,745 $3,465 $6,409 $8,077 $12,003 $0.00 plus 10%of amount over 227 . $37.30 plus 12% of amount over 600 $174.70 plus 22%of amount over 1745 $553.10 plus 24%of amount over 3465 $1,259.66 plus 32%of amount over 6409 $1,793.42 plus 35%of amount over 8077 $3,167.52 plus 37%of amount over 12003 $600 $1,745 $3,465 $6,409 $8,077 $12,003 • Amount of check = current earnings – FICA tax – income tax withheld
Your design must be according to the structure chart given here. That is main() will call input
function, calculation function, and output function in that order.
main()
Input all data
Handles all calculations
Output
Computes federal tax and FICA
Transcribed Image Text:Your design must be according to the structure chart given here. That is main() will call input function, calculation function, and output function in that order. main() Input all data Handles all calculations Output Computes federal tax and FICA
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education