Question: Consider the following code that will assign a letter grade of ' A ' , ' B ' , ' C ' , ' D

Consider the following code that will assign a letter grade of 'A','B','C','D', or 'F' depending on a student's test score.
if (score >=90) grade ='A';
if (score >=80) grade ='B';
if (score >=70) grade ='C';
if (score >=60) grade ='D';
else grade ='F';
A. This code will work correctly in all cases
B. This code will work correctly only if grade >=60
C. This code will work correctly only if grade <60
D. This code will work correctly only if grade <70
E. This code will not work correctly under any circumstances
You must explain your answer(s). Simply stating the answer(s) will result in 0 points awarded

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!