Question: This program segment needs to convert a score to its equivalent grade using the following conversion criteria: 'A' = 90 .. 100 'B' = 80

This program segment needs to convert a score to its equivalent grade using the following conversion criteria: 'A' = 90 .. 100 'B' = 80 .. 89 'C' = 70 .. 79 'F' = 0 .. 69

Consider the following program segment. Assume that this segment is executed five times with score values of 60, 70, 80, 90, and 100. What will be the five grades?

int score;

char grade;

score = some int value in the range [0..100]; // in five runs: 60, 70, 80, 90, and then 100.

if (score >= 90)

grade = 'A';

else if (score >= 80)

grade = 'B';

else if (score >= 70)

grade = 'C';

else

grade = 'F';

System.out.print(grade);

Question 6 options:

F C B A A

A A B C F

A B C F F

F F C B A

A B C D F

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!