Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Specification: The PC Pine Furniture Company has recently hired you to help them generate a payroll report for all their employees. You need to

image text in transcribedimage text in transcribed
Problem Specification: The PC Pine Furniture Company has recently hired you to help them generate a payroll report for all their employees. You need to declare arrays with Size 50 elements to read data and calculate results. You are given a data file containing the employee's data. The data for each employee consists of the employee id, name, hours worked and rate of pay. The number of employees in the file is unknown. However; the last id number is 0 and is used as a sentinel. You are to read this data into parallel arrays, calculate the gross pay, federal withholdings, state withholdings, Social Security withholding and net pay for each employee and store each in an array. You should define the followings as constants: SIZE = 50; . . Federal withholding tax rate: 17.5% State withholding tax rate: 5.5% . Social Security withholding: 2.5% Your output should be: . A report for all employees written to a file and consisting of the employee name, id number, gross pay and net pay. Another report written to a different file containing the total gross pay paid to all employees, total federal withholdings, total state withholdings, total Social Security withholding and total for all withholdings. Requirements: Comment thoroughly. Every function must have specifications in the form of comments. . Create global constants. Make sure every function accomplishes a task and is self-contained Use typedef to define new types as necessary. Each file has a heading and column labels to identify information. Must test if data file exists before reading data, and do not change my data. You may need to write additional functions such as total, which returns the total of an array. main is used as a driver function, no input/output or calculations is done in main, only what is specified. . Make sure that 0 is not entered into the ID array.Grading Criteria: 5 points there are sufficient comments in the program. 5 points typedef is used to define all arrays. 5 points a flowchart of the function main () "only main ()" is included and is correct. No pseudo- code will be accepted. 5 points each function have clear, full and thorough specifications. 5 points the function setdata () reads the data from the file into arrays, 0 is not data. 5 points a counter is used to count the number of employees read from the file. 5 points the function setdata() returns the number of employees read from the file as its value. 5 points generate an error if the input file does not exist, or if it's not open. 5 points the function findgross () fills the gross array with calculated data. 5 points the function findwithholding () accepts the gross array and withholding rate to calculate the withholdings. 5 points the function findwithholding () is reused to calculate different withholdings. 5 points the function findnet() fills the net array with calculated data. 5 points the function total () will return the total of its array argument. (reused). 10 points the function getdata () prints the requested information, with proper spacing and proper formatting. It also calls a function to print the headings and column titles, and calls a function to print the footing. 15 points the program runs according to the specifications above, and produces the intended results. 5 points source program, flowchart, data file and output files are submitted

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions