Question: Consider the previous question, but include + or letter grades. A+ is 4.25, A is 3.75, B+ is 3.25, B is 2.75, and so
Consider the previous question, but include + or − letter grades. A+ is 4.25, A− is 3.75, B+ is 3.25, B− is 2.75, and so on.
a. Why can’t we use one switch statement with no other conditionals to convert these additional letter grades?
b. Write a fragment of code that will do the conversion using a multibranch if-else statement.
c. Write a fragment of code that will do the conversion using nested switch statements.
Step by Step Solution
3.42 Rating (168 Votes )
There are 3 Steps involved in it
a The grade A would be a string but we cannot use switch on a string b ifenhancedLetterGradeequalsA ... View full answer
Get step-by-step solutions from verified subject matter experts
