Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
Java All : Switch Based Selections



Exam Questions
ICSE2018-03F  if-else-if to switch-case #4061 

Convert the following if else if construct into switch case
if( var==1)
System.out.println(“good”);
else if(var==2)
System.out.println(“better”);
else if(var==3)
System.out.println(“best”);
else
System.out.println(“invalid”);

Convert the following if else if construct into switch case
ICSE2014-08A  Term Deposit Recurring Deposit Calculation #7439 

Using the switch statement. write a menu driven program to calculate the maturity amount of a Bank Deposit.
The user is given the following options:
(i) Term Deposit
(ii) Recurring Deposit
For option (i) accept principal(P), rare of ¡interest(r) and time period in years(n). Calculate and output the maturity amount(A) receivable
using the formula

For option (ii) accept Monthly Installment (P), rate of interest(r) and time period in months (n). Calculate and output the maturity amount(A) receivable using the formula

For an incorrect option, an appropriate error message should be displayed.

Using the switch statement. write a menu driven program to calculate the maturity amount o ...

Exam Questions:3 
Back