SQA program for Compound interest

public class CompoundInterest {
2 
3    public void calculate(int p, int t, int r, int n) {
4        double amount = p * Math.pow(1 + (r / n), n * t);
5        double interest = amount - p;
6        System.out.println("Compond Interest is " + interest);
7        System.out.println("Amount is " + amount);
8    }
9}

0 comments:

Post a Comment