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 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
a char grade B ifgrade A grade is A SystemoutprintlnExcellent ifgra... View full answer
Get step-by-step solutions from verified subject matter experts
