-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSI.java
More file actions
38 lines (35 loc) · 1.16 KB
/
SI.java
File metadata and controls
38 lines (35 loc) · 1.16 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
import java.io.*;
class SI
{static float p,t,r;
static double a;
public static void main(String args[])throws IOException
{
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
System.out.println(" SCHEME ");
System.out.println(" DEPOSIT TIME RATE ");
System.out.println(" < 2000 >=2 5 ");
System.out.println(" < 6000 >=2 7 ");
System.out.println(" > 6000 >=1 8 ");
System.out.println(" ANY >=5 10 ");
System.out.println(" ANY ANY 3 ");
System.out.println();
System.out.println(" ENTER THE DEPOSIT, TIME ");
p=Float.parseFloat(buf.readLine());
t=Float.parseFloat(buf.readLine());
if(p<2000&&t>=2)
r=5;
else
if(p<6000&&t>=2)
r=7;
else
if(p>6000&&t>=1)
r=8;
else
if(t>=5)
r=10;
else
r=3;
a=p*Math.pow((1+r/100.0),t);
System.out.println("THE AMOUNT FOR DEPOSIT "+p+" FOR TIME "+t+" AT RATE "+r+" IS "+a);
}
}