Create a program that a professor can use to display a grade

Create a program that a professor can use to display a grade for any number of students. Each student\'s grade is based on four test scores, with each test worth 100 points. The program should total the student\'s test scores and then assign the appropriate grade using the information shown in Figure 8-27. Display the student\'s number and grade in a message, such as \"Student Is grade: A\" If necessary, create a new project named Introductoryl3 Project, and save it in the Cpp8\\Chap08 folder. Enter the C++ instructions into a source file named Introductoryl3.cpp. Also enter appropriate comments and any additional instructions required by the compiler. Save, run, and test the program.

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;
}

 Create a program that a professor can use to display a grade for any number of students. Each student\'s grade is based on four test scores, with each test wor
 Create a program that a professor can use to display a grade for any number of students. Each student\'s grade is based on four test scores, with each test wor

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site