4) Write an algorithm to take a list of numbers from user and determine the grade for CSCI1320 students. You need to first prompt the user to know how many students are in the class and then take the final scores in a list. After taking the scores, you check which grade the student has got based on the input score stored in the list. If the score is between or 90 and 100 then it’s an ‘A’ grade, if it’s between or 80 to 89 then ‘B’ grade and so on.
Input:
How many scores to input? 5
63 71 95 52 80
Output:
Grade D Score: 63
Grade C Score: 71
Grade A Score: 95
Grade F Score: 52
Grade B Score: 80
Hey here is answer to your question.
Take Input(number of scores [N])
for each i in 1 to N :
Take input of score
if score >= 90:
print "Grade "A" Score: i "
else if 90 > score >= 80:
print "Grade "B" Score: i "
else if 80 > score >= 70:
print "Grade "C" Score: i "
else if 70 > score >= 60:
print "Grade "D" Score: i "
else if 60 > score:
print "Grade "F" Score: i "
Get Answers For Free
Most questions answered within 1 hours.