Create a program that a professor can use to display a grade
Solution
#include <iostream>
 using namespace std;
int main(void)
 {
    int n;
    cout<<\"Enter the number of students:\";
    cin>>n;
    int score =0,temp;
    for(int i=0;i<n;i++)
    {
        score=0;
        if(i==0){cout<<\"Enter the details of first student:\"<<endl;}
        else {cout<<\"Enter the details of next student:\"<<endl;}
       cout<<\"Enter the score in 1st test:\";
        cin>>temp;
        score+=temp;
       cout<<\"Enter the score in 2nd test:\";
        cin>>temp;
        score+=temp;
       cout<<\"Enter the score in 3rd test:\";
        cin>>temp;
        score+=temp;
       cout<<\"Enter the score in 4th test:\";
        cin>>temp;
        score+=temp;
       if(score>=372 && score<=400)
        {
            cout<<\"Student \"<<i+1<<\" received an A grade\"<<endl;
        }
        else if(score>=340 && score<=371)
        {
            cout<<\"Student \"<<i+1<<\" received a B grade\"<<endl;
        }
        else if(score>=280 && score<=339)
        {
            cout<<\"Student \"<<i+1<<\" received a C grade\"<<endl;
        }
        else if(score>=240 && score<=279)
        {
            cout<<\"Student \"<<i+1<<\" received a D grade\"<<endl;
        }
        else
        {
            cout<<\"Student \"<<i+1<<\" received an F grade\"<<endl;
        }
    }
   return 0;
 }


