Question: Create a java class file named SwitchDemo.java. This class should satisfy the following requirements: a. Declare and initialize a character variable with a letter grade.

Create a java class file named SwitchDemo.java. This class should satisfy the following requirements: a. Declare and initialize a character variable with a letter grade.

b. Has nested ifelse statements that performs the following checks: i. If the letter grade is A, a message stating Great work is displayed ii. If the letter grade is B, a message stating Good work is displayed iii. If the letter grade is C, a message stating Average work is displayed iv. If the letter grade is D, a message stating Below average work is displayed v. If the letter grade is F, a message stating Unsatisfactory work is displayed vi. If the letter is anything other than the above values, a message stating that the letter was invalid should be displayed

c. Once the nested ifelse is completed, replicate the functionality using a switch statement instead

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!