using a class create a program with four privatemember variables and five member functions
that will read in each record from an input file, calculate thetotal pay for the thirty (30) employees and storing
the data into an array. The data is to then be printed to an outputfile.;
Description DataType Members
Employee IDs of INT employees_jd
Hours Worked of DOUBLE hrworked_jd
Pay Rate of DOUBLE payrate_jd
Total Pay of Double total_pay
Class name payroll
Member Functions
calcPay private pass computed Total Pay and store into array.
getinfo private get information from datafile.
putinfo private output data to datafile.
results public array of thirty (30), used to access privatefunction getinfo and calcPay to retrieve data
from input file and calculate Total Pay.
results2 public used to access private function putinfo to writethe array of data to an output file.
Total pay should be calculated by multiplying the hours worked bypay rate plus 10% of total pay for every five (5) hours
over forty (40). (i.e. a person working 50 hours with a total payof $100 would have ((50-40)/5)*(100*.1) added to
total pay.
Note: _jd represents the initials of the programmer. Your functionnames should be named by replacing the initials
jd with your first and last initials.
Excluding the main function, your program should have fiveadditional functions that will get the hours worked and
payrate, calculate the total pay, sort the data and display youroutput.
Read Input
File
Calculate
Average Output Results
Name of
function getinfo_jd calcPay_jd putinfo_jd
Properties of
function
Called from public
member function
results.
Called from public
member function
results.
Called from public
member function
results2.
Definition of
Function
Data should be
read from this file.
Should pass Total
Pay back to results.
Data should be printed
to this file.
Data file should be named data2_jd.txt
Expert Answer
Answer to using a class create a program with four private member variables and five member functions that will read in each recor…