Write multiway if-else statements in which letter grades are assigned based a numeric grade based on this “ten point” scheme: if the numeric grade is not less than 90, the letter grade is an A, if the numeric grade is not less than 80, the letter grade is a B, if the numeric grade is not less than 70, the letter grade is C, if the numeric grade is not less than 60, the letter grade is D, otherwise the letter grade is F.
What will be an ideal response?
if (numeric_grade >= 90)
letter_grade = ‘A’;
else if (numeric_grade >= 80)
letter_grade = ‘B’;
else if (numeric_grade >= 70)letter_grade = ‘C’;
else if (numeric_grade >= 60)
letter_grade = ‘D’; else
letter_grade = ‘F’;
Computer Science & Information Technology
You might also like to view...
Inheritance enables the programmer to
a) Reuse code b) Allow for Darwinian selection of class features as inheritance proceeds c) Better model the real world d) Provide facilities for class libraries.
Computer Science & Information Technology
It is important to ____ the line in the code editing window where you want to insert a code snippet to produce the shortcut menu in the accompanying figure.
A. click B. double-click C. right-click D. mouse over
Computer Science & Information Technology