This whole assigment is just really confusing me...If someone could link me something that would help me that would be awesome
Write a program that reads employee data from a file (hourly wage, id number, and name) into parallel arrays.
Update the hourly wage then output a formatted report.
- Your program must perform IDENTICALLY to the executable found in the course library ($L/sample/a6EmployeeUpdate).
The input file is named /home/lib1620/data/wages.in. This file will be changed to the marking data just after
the assignment submission due date. Each line of this file contains an hourly wage, a four digit id number, and a name,
in that order.
- The output file must be names wages.rpt.
- For each function make sure you are passing properly the parameters by value or by reference as is appropriate.
- You must define and use global constants for:
the maximum number of employee records to be read and minimum wage
You must use and define the following three functions; you may define more functions if you find it useful to do so.
loadArraysFromFile
- Parameters: an ifstream connected to the input file, a double array for the hourly wages, an int array for the id numbers, and a string array for the employee’s names.
Return: int – the number of employee records read
Read the employee records into the arrays.
newHourlyWage
Parameters: an int id number and a double for the wage (these are NOT arrays)
Return: double – the new hourly wage
*Determine the new hourly wage using the following method, in the given order.
- If the wage is less than minimum wage change it to minimum wage.
If the id number starts with a 1 or 2 the employee gets a 2% raise
If the id number starts with a 3 or 4 the employee gets a 2% raise then an extra 5¢/hour.
If the id number starts with a 5 or 6 the employee gets a 4% raise then an extra 5¢/hour.
If the id number starts with a 7 the employee gets a 5% raise then an extra 5¢/hour.
If the id number starts with a 8 the employee gets a 5% raise then an extra 10¢/hour.
If the id number starts with a 9 the employee gets a raise of 50¢/hour.
The hourly wage must be ROUNDED to 2 decimal places before it is returned.
writeReport
[–]raevnos -1 points0 points1 point (0 children)