Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Grade is A if scores is >= best – 10; Grade is B if scores is >= best – 20;

ID: 3536149 • Letter: G

Question

Grade is A if scores is >= best – 10;

Grade is B if scores is >= best – 20;

Grade is C if scores is >= best – 30;

Grade is D if scores is >= best – 40;

Grade is F otherwise.

The program prompts the user to enter all of the 10 scores and concludes by displaying the grades. Here is a sample run:

Enter 10 scores: 85 55 70 58 92 66 78 82 60 75

Student 0 score is 85 and grade is A

Student 1 score is 55 and grade is D

Student 2 score is 70 and grade is C

Student 3 score is 58 and grade is D

Student 4 score is 92 and grade is A

Student 5 score is 66 and grade is C

Student 6 score is 78 and grade is B

Student 7 score is 82 and grade is A

Student 8 score is 60 and grade is D

Student 9 score is 75 and grade is B

Explanation / Answer

#include<stdio.h>

int main()

{

int i,best=0,a[10];

printf(" Enter 10 scores:");

for(i=0;i<10;i++)

{

scanf("%d",&a[i]);

if(best<=a[i])

best=a[i];

}

for(i=0;i<10;i++)

{

if(best-a[i]<=10)

printf("Student %d score is %d and grade is A ",i,a[i]);

else if(best-a[i]<=20)

printf("Student %d score is %d and grade is B ",i,a[i]);

else if(best-a[i]<=30)

printf("Student %d score is %d and grade is C ",i,a[i]);

else if(best-a[i]<=40)

printf("Student %d score is %d and grade is D ",i,a[i]);

else

printf("Student %d score is %d and grade is F ",i,a[i]);

}

return 0;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote