Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class Menu_Driven{
- public static void main(String args[]) {
- System.out.println("Enter your choice.");
- System.out.println("1. Term Deposit");
- System.out.println("2. Recurring Despot");
- Scanner sc = new Scanner(System.in);
- int choice = sc.nextInt();
- System.out.println("Enter the principal.");
- double principal = sc.nextDouble();
- System.out.println("Enter the rate.");
- double rate = sc.nextDouble();
- double amount = 0.0;
- switch(choice){
- case 1:{
- System.out.println("Enter the time in years");
- int time = sc.nextInt();
- amount = ( principal * ( Math.pow( ( 1 + ( rate/100.0 ) ), time ) ) );
- System.out.println("The maturity amount is " +amount);
- break;
- }
- case 2:{
- System.out.println("Enter the time in months");
- int time = sc.nextInt();
- /*
- *
- * ENTER CODE HERE
- *
- */
- break;
- }
- default:{
- System.out.println("Invalid input.");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment