Question: help #include #include #include using namespace std; int main() { float num, average = 0, sum = 0; int cnt = 0; fstream inputfile, outputfile;

help

#include  #include  #include  using namespace std; int main() {  float num, average = 0, sum = 0; int cnt = 0;  fstream inputfile, outputfile;  //a) Open the input file named "fileInp.txt" (2 marks)  Answer;  //b) Open the output file named "fileOut.txt" (2 marks)  Answer;  //c) Check for successful opening file (2 marks)  if (Answer) {  cout  return 0;  }   //d) Read data from the input file (2 marks)  while (Answer) { //e) Write data to the output file (2 marks) outputfile  sum = Answer;  cnt++;  }   //g) Calculate average (1 mark) average = Answer; //h) Display average to the output file (1 mark)  outputfile  Answer;  //j) Close the output file (1 mark)  Answer;  return 0; } 

help #include #include #include using namespace std; int main() { float num,average = 0, sum = 0; int cnt = 0; fstream inputfile,

Hinclude #include #include using namespace std; int main() { float num, average = , sum = 0; int cnt = ; fstream input file, output file; 16 17 18 19 10 111 //a) Open the input file named "fileInp.txt" (2 marks) 12 13

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!