Write a program to read in a collection of exam scores ranging in value from 0 to 100. Your program should count and print the number of outstanding scores (90 - 100), the number of satisfactory scores (60 - 89), the number of unsatisfactory scores (0 - 59) and the number of invalid scores (less than 0 or greater than 100).Code:#include <iostream> #include <iomanip> #include<fstream> using namespace std; int main() { int grade, kount, average, max_score, min_score; kount = 0; ifstream inFile; inFile.open("i:\\programming\\grades.txt"); inFile >> grade; while (!inFile.eof()) { if (grade >= 0 && grade <= 100) kount += 1; cout << "\n" << setw(10) << grade; if (grade < 0 || grade > 100) cout << " Invalid \n"; if (grade >= 0 && grade <= 59) cout << " Unsatisfactory \n"; if (grade >= 60 && grade <= 89) cout << " Satisfactory \n"; if (grade >= 90 && grade <= 100) cout << " Outstanding \n\n"; else cout << endl; inFile >> grade; } inFile.close(); cout << "\n\n\n Hit enter to continue..."; cin.get(); return 0; }
It should display the average score (with 2 decimal digits), the highest score, the lowest score, and the category of every score. Do not include the invalid scores in the average, max, or min. You will need to create a data file named grades.txt.
Can I get some help with this? Not exactly the whole answer (if you gave me that I wouldn't be mad though) but just something to put me in the right path.