Write a C++ program to calculate a person’s pay stub assuming paid on a weeklybasis.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.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.CALCULATIONSThere is one main calculation functionwhich calls another function that will compute the FICA tax and the federal income tax.•Current earnings arecomputed as hourly wage times hours worked (extra credit if your program paystime-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 $142,800, multiply current earnings by 6.2%; if year-to-date earnings greater than or equal to 142,800 there is no FICA taxi.e. 0.00 .•To compute federal income tax to be withheld, first subtract the product of the withholding allowances times82.70from current earnings and compute tax according to chart below:(a) SINGLEpersonIf the amount of wages (after subtracting withholding allowances) is:Tax is:Over—But not over—Not over $241. . . . . . . $0main()Input all dataHandles all calculationsOutputComputes federal tax and FICA tax

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 weeklybasis.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.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.CALCULATIONSThere is one main calculation functionwhich calls another function that will compute the FICA tax and the federal income tax.•Current earnings arecomputed as hourly wage times hours worked (extra credit if your program paystime-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 $142,800, multiply current earnings by 6.2%; if year-to-date earnings greater than or equal to 142,800 there is no FICA taxi.e. 0.00 .•To compute federal income tax to be withheld, first subtract the product of the withholding allowances times82.70from current earnings and compute tax according to chart below:(a) SINGLEpersonIf the amount of wages (after subtracting withholding allowances) is:Tax is:Over—But not over—Not over $241. . . . . . . $0main()Input all dataHandles all calculationsOutputComputes federal tax and FICA tax
 
 
 
 
 
 
 
$241$433$0.00 plus 10% of the amount over 241$433$1,021$19.20plus 12% of the amount over 433$1,021$1,902$89.76plus 22% of the amount over 1021$1,902$3,413$283.58plus 24% of the amount over 1902$3,413$4,269$646.22plus 32% of the amount over 3413$4,269$10,311$920.14plus 35% of the amount over 4269$10,311. . . . . . . . . . . . $3034.84plus 37% of the amount over 10,311(b) MARRIED person—If the amount of wages (after subtracting withholding allowances) is:Tax is:Not over $483. . . . . . . $0 Over—But not over—$483$865$0.00 plus 10%of amount over 483$865$2041$38.20plus 12%of amount over 865$2,041$3,805$179.32plus 22%of amount over 2041$3,805$6,826$567.40plus 24%of amount over 3805$6,826$8,538$1292.44plus 32%of amount over 6826$8,538$12,565$1,840.28plus 35%of amount over 8538$12,565. . . . . . . . . . . $3,249.73plus 37%of amount over 12565•Amount of check = current earnings –FICA tax –income tax withheldOUTPUTName 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 ISSUESFunctions, sub-functions, pass by referenceAbsolutely no global variables permittedTEST DATANameHourlyHours WithholdingMaritalYear-to-dateWageWorkedAllowancesStatusEarningsAl Clark48.50382M88,600.00Karen Chen44.00353M68,200.00Nathan Chan25.50501S36,295.50
 
 
 
 
 
 
 
SAMPLE OUTPUTFOR TEST DATA 1Al ClarkCurrent Earnings1843.00Year-to-date90443.00FICA tax114.27Income Tax Withheld 135.71Amount of check1593.02CHECKPOINTS1) Include name, e-mail, and lab# as comments in the code and also include code to output thisinformation to the output.2) Minimum ofthree (3) comments (including Pre/Post) in each functionof 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 exactlyone 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 calculateexactlythe 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.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
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