Question: Classes Program Assignment Referring to the structure assignment, create a class with four private member variables and five member functions; write a program that will
Classes Program Assignment
Referring to the structure assignment, create a class with four private member variables and five member functions; write a program that will read in records from an input file onto an array, calculate the total pay for ten employees and storing the data into an array. The data is to then be written to an output file.
Description DataType Members
Employee IDs of INT employeesjd
Hours Worked of DOUBLE hrworkedjd
Pay Rate of DOUBLE payratejd
Total Pay of Double totalpay
Class name
Member Functions
payroll
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 ten used to access private function getinfo and calcPay to retrieve data
from input file and calculate Total Pay.
results
public
used to access private function putinfo to write the array of data to an output file.
Total pay should be calculated by multiplying the hours worked by pay rate plus overtime rate for any hours worked over forty
Note:jd represents the initials of the programmer. Your function names should be named by replacing the initials jd with your first and last initials.
Excluding the main function, your program should have five additional functions that will get the hours worked and payrate, calculate the total pay, and display your output.
Read Input
File
Calculate Average
Output Results
Name of function
getinfojd
calcPayjd
putinfojd
Properties of function
Called from public member function results.
Called from public member function results.
Called from public member function results
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 datajdtxt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
