Question: Rewrite the following code, from an IF-ELSE IF statement to a switch statement. if(choice == 5) { var -= 15; } else if(choice == 4)
Rewrite the following code, from an IF-ELSE IF statement to a switch statement. if(choice == 5) { var -= 15; } else if(choice == 4) { var -= 25; } else if(choice 3 || choice == 2) { var -= 35; } else { var -= 45; } ==
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
