Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

(3) f YZ|x(y, z). Does the value depend on x? Pg45

Answered: 1 week ago