Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 3 c++ Objective: The purpose of this project is to expose you to: One-dimensional parallel arrays, input/output, Manipulating summation, maintenance of array elements. In

Project 3 c++

Objective:

The purpose of this project is to expose you to:

One-dimensional parallel arrays, input/output, Manipulating summation, maintenance of array elements. In addition, defining an array type and passing arrays and array elements to functions.

Problem Specification:

The PC Pine Furniture Company has recently hired you to help them generate a payroll report for all their employees. You are given a data file containing the employees 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 employee id number is 0. 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:

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.

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 a counter is used to count the number of elements read.

5 points generate an error if file does not exist, or if not open.

5 points a loop reads the data until the trailing value 0 for ID is encountered.

5 points each function have clear, full and thorough specifications.

5 points the function setdata () reads the data from the file into arrays.

5 points the function setdata() returns the number of employees read from the file as its value.

5 points the function findgross () fills the gross array with calculated data.

5 points the function findwithholding () accepts the needed data for an employee and returns the withholdings.(I don't know how to return an array from an function without using pointer and vector. And also read that array[index++] does not affect the value of array[index].)

5 points the function findwithholding () is reused to calculate different withholding.

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).

5 points headings (), prints the headings and column titles, formatted and looks nice.(i dont know how to use iomanip to print like a table).

5 points data/calculated results are printed with proper spacing and proper formatting.

20 points the program runs according to specifications above, and produces the intended results.

5 points source program, flowchart, data file and output files are submitted.

Submission Details:

Submit a print-out of:

The source files

Hierarchical chart

A flowchart (pseudo code is not acceptable)

A copy of the input data file

A copy of the output files.

*** ***

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

Database Theory Icdt 99 7th International Conference Jerusalem Israel January 10 12 1999 Proceedings Lncs 1540

Authors: Catriel Beeri ,Peter Buneman

1st Edition

3540654526, 978-3540654520

More Books

Students also viewed these Databases questions