Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE ANSWER AS SOON AS POSSIBLE given payrollFile.cpp code: // File: Payroll.cpp // Creates a company employee payroll file // computes total company payroll amount
PLEASE ANSWER AS SOON AS POSSIBLE
given payrollFile.cpp code:
// File: Payroll.cpp // Creates a company employee payroll file // computes total company payroll amount #includeWrite a program that prints payroll checks using the file produce by the payroll program described in payrollFile.cpp. The format of the checks should be similar to the one shown in the following figure: Rowan University Glassboro, NJ Check No. 001 Date: todays date Pay to the Order of: elliotkoffman $400.00 Your name// required for file streams #include // for definition of EXIT_FAILURE #include #include using namespace std; // Associate streams with external file names #define inFile "EmpFile.txt" // employee file #define outFile "Salary.txt" // payroll file // Functions used ... // PROCESS ALL EMPLOYEES AND COMPUTE TOTAL float processEmp(istream&, ostream&); int main() { ifstream eds; // input: employee data stream ofstream pds; // output: payroll data stream float totalPayroll; // output: total payroll // Prepare files. eds.open(inFile); if (eds.fail ()) { cerr > firstName >> lastName >> hours >> rate; while (!eds.eof()) { salary = hours * rate; pds > firstName >> lastName >> hours >> rate; } // end while return payroll; } // end processEmp
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started