-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathAccount.java
More file actions
37 lines (36 loc) · 848 Bytes
/
Account.java
File metadata and controls
37 lines (36 loc) · 848 Bytes
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
import java.util.*;
class Account
{
public static void main()
{
Scanner in=new Scanner(System.in);
System.out.println("Press 1 for Term Deposit is : ");
System.out.println("Press 2 for Recurring Deposit : ");
System.out.println("Enter your choice");
int n=in.nextInt();
switch(n)
{
case 1:
System.out.println("Enter Principal : ");
double a=in.nextInt();
System.out.println("Enter Rate : ");
double b=in.nextInt();
System.out.println("Enter Time in year : ");
double c=in.nextInt();
double am=a*(Math.pow(1+b/100,c));
System.out.println(am);
break;
case 2:
System.out.println("Enter Monthly Installments");
double m=in.nextInt();
System.out.println("Enter Rate");
double r=in.nextInt();
System.out.println("Enter Time in month");
double t=in.nextInt();
double z=m*(t+m)*((t*(t+1))/2)*(t/100)*(1/12);
System.out.println(z);
break;
default:
}
}
}