Question: please write solution using C++ program. Using Array to calculate the average of 5 grades: 1. read grade from user input. 2. read grades from
please write solution using C++ program.
Using Array to calculate the average of 5 grades:
1. read grade from user input.
2. read grades from the file.
// Hint:
const int ISIZE = 5, sales[ISIZE];
ifstream dataFile;
datafile.open("sales.dat");
if (!dataFile)
cout << "Error opening data file ";
else
{ // Input daily sales
for (int day = 0; day < ISIZE; day++)
dataFile >> sales[day];
dataFile.close();
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
