A supervisor in a manufacturing company wants to produce areport from a “product
ID: 3617172 • Letter: A
Question
A supervisor in a manufacturing company wants to produce areport from a “production” input fileproject6.dat showing the bonuses sheplans to give based on this year’s production. Write a C++program that reads and processes this input file. Each record(line) of the input file contains an employee number (nine digits),the employee’s production last year, and the employee’sproduction this year. (An employee’s production is measuredin integer units.)
Your program is to read the input file and produce a bonusreport written to an output file (you choose its location andname). The report shall display a line for each employee, and eachline shall contain the employee number, the employee’sproduction last year, the employee’s production this year,and the calculated bonus. The amount of the bonus is computed asfollows:
Display at the bottom of the report the total number of bonusesand the average bonus to be distributed.
Use a separate function to calculate the bonus.
Explanation / Answer
please rate - thanks #include #include #include using namespace std; double getbonus(int,int); int main() {int num,i=0,lasty,thisy,count=0; double bonus,sum=0,average; ifstream in; ofstream out; in.open("project6.dat"); if(in.fail()) { coutlasty; in>>thisy; bonus=getbonus(lasty,thisy); if(bonus>0) count++; sum+=bonus; outRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.