Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program is an exercise in array processing. The input file has a list of employees' records. Each record contains: employee_name hourly_wage hours_worked You are

This program is an exercise in array processing. The input file has a list of employees' records. Each record contains:

employee_name

hourly_wage

hours_worked

You are to:

- First read all the data into three arrays before processing any records.

- Report the number of records read in.

- Report the employee with the highest wage in the group.

- Report the employee with the lowest wage in the group.

- Print a final report, reporting names, gross pay, etc.

- Add a $50 bonus to the gross pay of any person working more than 45 hours.

- Fine an employee $.25 an hour if they work less than 30 hours.

- Use one output file for your results.

image text in transcribed

General Requirements:

1. You must use main() and at least three additional functions: process_payroll(), process_employees(), and print_results(). Optional to have more functions to calculate maximum, minimum, and average pay.

2. You will need to use at least three arrays for this program. These arrays are hours, wage, and employee. The maximum size name will be 15 characters. You may need to use other arrays for gross and adjusted_gross.

3. There will be at least 10 names to read in. I expect to see error processing in case more than 10 names are attempted to be read in. I want you to process all records just indicate an error if more than 10 names are read in.

4. The minimum pay rate should be before any fines are levied.

5. Make up variable names that are meaningful.

6. Indent consistently and use white space (blanks and blank lines) appropriately.

7. Have a block comment at the start of your program with name, etc.

8. Have a block comment before each function with the name and a short description.

9. Use additional comments as necessary.

10. Use symbolic constant values such as penalty (e.g. const float PENALTY = 0.25;)

11. Prototype your functions.

12. Do NOT use global variables

13. Correctness of summary output

14. Alignment of summary output

15. Correctness of maximum, minimum , and average pay

A sample input file looks like the following: Clinton Lincoln Washington 32.00 35 Kennedy Nixon 10.00 10 5.00 50 4.99 45 10.00 25 The corresponding sample output would be: Number of Employees: 5 Maximum Pay Rate: Washington @ $32.00 Minimum Pay Rate: Kennedy @ $4.99 Average Pay: $12.40 October 2009 Payroll: Name Hours Rate Gross Bonus Adjusted_Gross Clinton Lincoln Washington Kennedy Nixon 10 50 35 45 25 10.00 100.00 5.00 250.00 32.00 1120.0 4.99 224.55 10.00 250.00 97.50 300.00 1120.00 224.55 243.75

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_2

Step: 3

blur-text-image_3

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago

Question

Understand why customers are loyal to a particular service firm.

Answered: 1 week ago