Question: 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

 Given an incomplete program below, complete the program by filling inthe blanks with an appropriate C++ statement according to the instructions stated

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 land the expected data in the output file is shown in Figure 2. Note: Please write C ++ statements WITHOUT blank spaces unless it i absolutely needed. Example: int num,ab; T S I AN Y Q B A T I N T UN A DA H L Figure 1: Input file QB s Y A H A D TAN T I N T Figure 2: Output file AL A H UN 1 2 13 4 #include #include #include using namespace std; int main() { char name[10][40]; int cnt = ; fstream inputfile, output file; 6 18 9 10 //a) Open the input file named "input.txt" (2 marks) 11 12 13 14 1/b) Open the output file named "output.txt" (2 marks) ; 1/c) Check for successful opening file (2 marks) if ( ) { cout =0; i--) 34 35 36 37 38

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!