-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask14.java
More file actions
44 lines (42 loc) · 878 Bytes
/
Task14.java
File metadata and controls
44 lines (42 loc) · 878 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
38
39
40
41
42
43
44
import java.io.*;
import java.util.*;
class Interest
{
private long p;
private long n;
private long r;
long si;
//parametrise constructor
Interest(long p1,long n1,long r1)
{
p=p1;
n=n1;
r=r1;
}
public long simpleInterest(long a,long b,long c)
{
si=(a*b*c)/100;
return si;
}
public void show()
{
System.out.println(si);
}
}
class test
{
public static void main(String... args)
{
long p1,n1,r1;
Scanner sc = new Scanner(System.in);
System.out.println("Enter the pricipal amount : ");
p1=sc.nextLong();
System.out.println("Enter the time amount : ");
n1=sc.nextLong();
System.out.println("Enter the rate amount : ");
r1=sc.nextLong();
Interest obj = new Interest(p1,n1,r1);
obj.simpleInterest(p1,n1,r1);
obj.show();
}
}