In: Computer Science
In C++ Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below.
#include <iostream> using namespace std; int main() { int grades[4], highest, lowest, sum = 0; cout<<"Enter four integer values between 0 and 100: "; cin>>grades[0]; highest = grades[0]; lowest = grades[0]; sum = grades[0]; for(int i = 1;i<4;i++){ cin>>grades[i]; if(highest < grades[i]){ highest = grades[i]; } if(lowest < grades[i]){ lowest = grades[i]; } sum += grades[i]; } for(int i = 0;i<4;i++){ cout<<grades[i]<<" "; } cout<<endl; cout<<highest<<endl; cout<<lowest<<endl; cout<<(sum/4.0)<<endl; return 0; }