Question: Fill in the missing C++ code in program Reverse. Put the following data in file reverse.dat. Run the program and show the results displayed on

Fill in the missing C++ code in program Reverse. Put the following data in file reverse.dat. Run the program and show the results displayed on the screen. 2 4 5 3 7 9 1 6 8 0

// Program Reverse reads numbers into an array

// and prints them out in reverse order.

#include

#include

usingnamespace std;

constint MAX = 10;

int main()

{

int numbers[MAX];

ifstream inData;

int value;

int index;

inData.open("reverse.dat");

for (index = 0; index < MAX; index++)

{

// FILL IN code to read value from file

// FILL IN code to store value into numbers

}

for (index = MAX - 1; index >= 0; index--)

// FILL IN code to write numbers on the screen

return 0;

}

Lastly, extend the program reverse to print the sum of the values stored in the array numbers.

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 Programming Questions!