Answer:
The program in C++ is as follows:
#include <iostream>
using namespace std;
int main(){
int scores[6];
int sum =0;
string grade;
for(int i =0; i < 6; i++){
cin>>scores[i];
sum+=scores[i]; }
double percent = sum/6.0;
if(percent > 90){ grade ="A"; }
else if(percent>75){ grade ="B+"; }
else if(percent>70){ grade ="B"; }
else if(percent>65){ grade ="C+"; }
else if(percent>60){ grade ="C"; }
else if(percent>55){ grade ="D+"; }
else if(percent<50){ grade ="F"; }
cout<<grade;
return 0;
}
Explanation:
This declares the 6 scores using an array
int scores[6];
This initializes the sum of all scores to 0
int sum =0;
This declares the grade as string
string grade;
This iterates through the scores
for(int i =0; i < 6; i++){
This gets input for each score
cin>>scores[i];
This adds up the scores
sum+=scores[i]; }
This calculates the percentage
double percent = sum/6.0;
The following if statements determine the grade
<em> if(percent > 90){ grade ="A"; }</em>
<em> else if(percent>75){ grade ="B+"; }</em>
<em> else if(percent>70){ grade ="B"; }</em>
<em> else if(percent>65){ grade ="C+"; }</em>
<em> else if(percent>60){ grade ="C"; }</em>
<em> else if(percent>55){ grade ="D+"; }</em>
<em> else if(percent<50){ grade ="F"; }</em>
This prints the grade
cout<<grade;