Wednesday, October 24, 2012

Java Exercise #30: Assign Grades

This program is to read student scores and assign grades to each student

Exercise: Write a program that reads student scores, get the best score and then assign grade to each student using the following scheme:


       Grade is A if score is >= best - 10;
       Grade is B if score is >= best - 20;
       Grade is C if score is >= best - 30;
       Grade is D if score is >= best - 40;
       Grade is F otherwise.
  


Enter the number of students: 4

Please enter a score: 40
Please enter a score: 50
Please enter a score: 60
Please enter a score: 70
Student 0 score is 40 and grade is C
Student 1 score is 50 and grade is B
Student 2 score is 60 and grade is A
Student 3 score is 70 and grade is A

Download Code: Assign Grades

No comments:

Post a Comment