For part A you can manually type the data into a file,your program does not have
ID: 3653587 • Letter: F
Question
For part A you can manually type the data into a file,your program does not have to write that data make sure you can read the data from your file(try reading the data and printing it to the terminal) A loop should terminate when the end of file has been encountered. a. Store the following in a file: 5 96 87 78 93 21 4 92 82 85 87 6 72 69 85 75 81 73 b. Write a C++ program to calculate and display the average of each group of numbers in the file created. The data is arranged in the file so that each group of numbers is preceded by the number of data items in the group. Thus for the first number in the file, 5, indicates that the next five numbers should be grouped together. The number 4 indicates that the following four numbers are a group, and the 6 indicates that the last six numbers are a group.Explanation / Answer
#include #include #include using namespace std; //uses inputfile.dat void processfile(); int main(){ processfile(); coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.