Question: Use a switch statement to rewrite the following if statement if(a == 1) x += 5; else if(a == 2) x += 10; else
Use a switch statement to rewrite the following if statement if(a == 1) x += 5; else if(a == 2) x += 10; else if(a == 3) x += 16; else if(a == 4) x += 34;
Step by Step Solution
There are 3 Steps involved in it
Heres how to use a switch statement in Java to alter the provide... View full answer
Get step-by-step solutions from verified subject matter experts
