1. Consider the previous question, but include + or − letter grades. O + is 5.25, O− is 4.75, E + is 4.25, E − is 3.75, and so on. a. Why can’t we use one switch statement with no other conditionals...


1. Consider the previous question, but include + or − letter grades. O + is 5.25,


O− is 4.75, E + is 4.25, E − is 3.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.


2. Imagine a program that displays a menu of five possible choices, lettered



a
through
e. S uppose the user’s selection is read into the character variable


choice. Write a switch statement that reacts to this choice by displaying


a message that indicates the choice. Display an error message if the user


makes an invalid choice.



Nov 16, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here