Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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; } 

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago