-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenudrivenbankprogram.java
More file actions
47 lines (45 loc) · 1.56 KB
/
Copy pathmenudrivenbankprogram.java
File metadata and controls
47 lines (45 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import java.util.*;
public class menudrivenbankprogram
{
public static void main(String[] args)
{
float p,r,t;
Scanner s = new Scanner(System.in);
System.out.println("User Menu:\n");
System.out.println("1.Term deposits:");
System.out.println("2.Recurring deposits:");
System.out.println("Enter your choice:");
int ch=s.nextInt();
switch(ch)
{
case 1:
{
System.out.println("enter the principal value:");
p= s.nextFloat();
System.out.println("enter the rate of interest:");
r=s.nextFloat();
System.out.println("enter the time taken:");
t=s.nextFloat();
double a= 1+(r/100);
double A=p*(Math.pow(a,t));
System.out.println("Maturity amount:"+A);
}
break;
case 2:
{
System.out.println("enter the monthly installment:");
p=s.nextFloat();
System.out.println("enter rate of interest:");
r=s.nextFloat();
System.out.println("ente the time in years:");
t=s.nextFloat();
double a=(r/100)*(1/12);
double b=(t*(t+1)/2)*a;
double A=(p*t)+(p*b);
System.out.println("Maturity amount:"+A);
}
break;
default:System.out.println("Wrong choice:");
}
}
}