Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Extra Credit 02: Employee's Weekly Pay (25 points) A company hired 10 temporary workers who are paid hourly and you are given a doa file

image text in transcribed
Extra Credit 02: Employee's Weekly Pay (25 points) A company hired 10 temporary workers who are paid hourly and you are given a doa file that contains the last name of the employees, the number of hours each employee worked in a week, and the hourly pay rate of each employee. You are asked to write a program that computes each employee's weekly pay and the average salary of all the workers. The program then outputs the weekly pay of each employee, the average weekly pay, and the names of ali the employees whose pay is greater than or equal to the average pay. If the number of hours worked in a week is more than 40 hours, then the pay rate for the hours over 40 is 1.5 times the regular hourly rate. Use two parallel arrays: a one-dimensional array to store the names of all the employees, and a two-dimensional array of 10 rows and 3 columns to store the number of hours an employee worked in a week, the hourly pay rate, and the weekly pay. Your program must contain at least the following functions-a function to read the data from the file into the arrays, a function to determine the weekly pay, a function to output the names of all the employees whose pay is greater than or equal to the average weekly pay, and a function to output each employee's data. Sample Output for Extra Credit 02 ohnsorn Aniston ooper upta Blair Clark ame Hrs Worked Pay Rate Salary 12.58 875.ee 13.25 1026.88 14.50 797.58 14.75 1253.75 68.00 65.00 50.00 70.00 55.60 1.5 656.25 40.00 45.80 60.80 65.60 18.75 1453.13 38.00 18.75 750.09 20.50 973.75 20.00 1400.e onson 65. .75 Smith Agerage Salary: $947.88 Employees whose salaries are greater than or equal to the average salary 9.75292.56 Aniston Gupta Kennedy Bronson Sunny Extra Credit 02 Grading Criteria 5 points-a function to read the data from the file into the arrays 5 points- a function to determine the weekly pay 10 points- a fiunction to output the names of all the employees whose pay is greater than .5 points will be deducted if you do not check if the file is opened. . 5 points will be deducted if the output is not in appropriate format or equal to the average weekly pay 5 points- a function to output each employee's data 5 points will be deducted if you do not use 2D array correctly 2.5 points will be deducted if you do not include at least one paragraph for analyzing the problem and one paragraph for designing a solution 2.5 points will be deducted if you do not include comments within your code

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions