Question: Convert the following if-else-if statement into an equivalent switch statement. 77 Find interest rate based on year if (numofYears 7) annualInterestRate 7.25; ho else if
Convert the following if-else-if statement into an equivalent switch statement. 77 Find interest rate based on year if (numofYears 7) annualInterestRate 7.25; ho else if (numofYears 15) annualInterestRate 8.50; else if (numofYears =- 30) annualInterest Rate = 9.0; else { System.out.println("Wrong number of years"); system.exit(0)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
