Solved

Rewrite the Following Set of If Statements Using a Nested

Question 24

Essay

Rewrite the following set of if statements using a nested if-else structure.
if (score >= 90) grade = 'A';
if (score >= 80 && score < 90) grade = 'B';
if (score >= 70 && score < 80) grade = 'C';
if (score >= 60 && score < 70) grade = 'D';
if (score < 60) grade = 'F';

Correct Answer:

verifed

Verified

if (score >= 90) grade = 'A';
...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions