Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Convert the following switch statement to a series of if, else-if, else statements. // Find interest rate based on year switch( numOfYears ) { case
Convert the following switch statement to a series of if, else-if, else statements.
// Find interest rate based on year switch( numOfYears ) { case 7: case 8: annualInterestRate = 7.50; break; case 15: annualInterestRate = 8.50; break; case 30: annualInterestRate = 9.0; break; default: System.out.println( "Wrong number of years" ); System.exit(0); }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started