Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include<iostream> #include<fstream> using namespace std; int addnum( ifstream &

ID: 661580 • Letter: #

Question

#include<iostream>
#include<fstream>
using namespace std;
int addnum( ifstream & in, ofstream & out)
{
int counter;
while(!in.eof())
{
in>>counter;
counter++;
out<<counter;
}

}
int main()
{
char inputfile[300]="zzin1.dat";
char outputfile[300]="acdc1.dat";
ifstream f1;
f1.open(inputfile);
ofstream f2;
f2.open(outputfile);
addnum(f1,f2);
return(0);

Write a short C++ program to read integers from a file named zzinl.dat (5, 7, 21, 2,-9,10, 3,1, 11) until the EOF condition is reached add 1 to each value and save it to an output file name acdcl.dat

Explanation / Answer

Pseudo Code: