Question: this is a c++ question...please help...urgent Given an incomplete program below, complete the program by filling in the blanks with an appropriate C++ statement according

this is a c++ question...please help...urgent

Given an incomplete program below, complete the program by filling in the blanks with an appropriate C++ statement according to the instructions stated in the comments. This program intends to read the data from the input file (input.txt) and to display the data into the output file (output.txt). The data in the input file is shown in Figure 1 and the expected data in the output file is shown in Figure 2. Note: Please write C ++ statements WITHOUT blank spaces unless it is absolutely needed. Example: int num,a,b;

this is a c++ question...please help...urgent Given an incomplete program below, complete

#include  #include  #include  using namespace std; int main() {  char name[10][40];  int cnt = 0;  fstream inputfile, outputfile;  //a) Open the input file named "input.txt" (2 marks)  Answer;  //b) Open the output file named "output.txt" (2 marks)  Answer;  //c) Check for successful opening file (2 marks)  if (Answer) {  cout  return 0;  }   //d) Read data from the input file (4 marks)  do {  Answer(Answer, 40);  cnt++;  } while (Answer);  //e) Write data to the output file (3 marks)  for (int i=cnt-2; i>=0; i--)  Answer   //f) Close the input file (1 mark)  Answer;  //g) Close the output file (1 mark)  Answer;  return 0; } 

A N YAH Q B A T N TUN A D A H L Figure 1: Input file I A L A H UN I OB S Y A H A D A N I N T Figure 2: Output file T 1 2 3 4 5 #include #include #include using namespace std; int main() { char name[10] [40]; int cnt = 0; fstream inputfile, outputfile; 16 7 8 9 10 11 //a) Open the input file named "input.txt" (2 marks) 12 ; 13 14 15 //b) Open the output file named "output.txt" (2 marks) 16 ; 17 18 19 //c) Check for successful opening file (2 marks) 20 if ( ){ 21 22 cout =0; i--) 36 37

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!