We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68c9cd1 commit 8a16975Copy full SHA for 8a16975
1 file changed
simpleInterest.java
@@ -0,0 +1,13 @@
1
+public class JavaExample {
2
+
3
+ public void calculate(int p, int t, double r, int n) {
4
+ double amount = p * Math.pow(1 + (r / n), n * t);
5
+ double cinterest = amount - p;
6
+ System.out.println("Compound Interest after " + t + " years: "+cinterest);
7
+ System.out.println("Amount after " + t + " years: "+amount);
8
+ }
9
+ public static void main(String args[]) {
10
+ JavaExample obj = new JavaExample();
11
+ obj.calculate(2000, 5, .08, 12);
12
13
+}
0 commit comments