Use C++ Visual Studio
Task 1: One-dimensional arrays with integer indexes Exercise I. Create a new C++ project in Visual Studio, add a new C++ file and copy the following code into it:
reverse.txt
// and prints them out in reverse order.
12. 34. 76. 82. 10. 55. 76. 88. 33. 65.
#include <iostream>
#include <fstream>
using namespace std;
const int MAX = 10;
int main() {
int numbers[MAX];
ifstream inData;
int value;
int index;
inData.open("reverse.txt");
for (index = 0; index < MAX; index++) {
// FILL IN Code to read value from file inData
// and store it in array numbers at position indicated by variable index
}
for (index = MAX - 1; index >= 0; index--) {
// FILL IN Code to write numbers on the screen
}
system("pause");
return 0;
}
Exercise 2. Complete the missing code under the highlighted lines and run the program with the sample data above.
Exercise 3 Extend the program to compute and display the sum of the values stored in array numbers. What was displayed by the program for the above sample data?
Exercise 4. Paste a copy of your source code and a screenshot showing program output below.