Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that reads 20 data values from a datafile to fill a one dimensio

ID: 3615764 • Letter: W

Question

Write a program that reads 20 data values from a datafile to fill a one dimensional array with 20 storagelocations. Assume the name of the array is DATA and the nameof the data file is VALUES.cpp. Also, assume the data in thefile is in one long column. Finally, the program shouldincrement each of these values by 5 and then write these new valuesto a data file called ANSWERS.cpp. test can be made using a data file with number1 to 20 storedin there Write a program that reads 20 data values from a datafile to fill a one dimensional array with 20 storagelocations. Assume the name of the array is DATA and the nameof the data file is VALUES.cpp. Also, assume the data in thefile is in one long column. Finally, the program shouldincrement each of these values by 5 and then write these new valuesto a data file called ANSWERS.cpp. test can be made using a data file with number1 to 20 storedin there

Explanation / Answer

#include    #include using namespace std;    main() { int i, counter =0;     int DATA[20];     ifstream in("VALUES.cpp"); ofstream out("ANSWERS.cpp"); if(!in) {     cout > i) {      DATA[counter]=i;    out