Question: a. Rewrite the following code segment using if statements. Assume that grade has been declared as of type char. char grade= 'B';; switch (grade)

a. Rewrite the following code segment using if statements. Assume that grade has been declared as of type

a. Rewrite the following code segment using if statements. Assume that grade has been declared as of type char. char grade= 'B';; switch (grade) { case 'A': System.out.println("Excellent"); break case 'B': System.out.println("Good"); default: System.out.println("you can do better"); } b. write Java code that inputs an integer and prints each of its digit followed by ** e.g if the integer is 1234 then it should print 1*2**3**4 e.g. if the integer is 85 then it should output 8**5 41. Focus

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a char grade B ifgrade A grade is A SystemoutprintlnExcellent ifgra... View full answer

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 Programming Questions!