KnowledgeBoat Logo

Computer Applications

Write a program to calculate the compound interest.

Java

Java Intro

51 Likes

Answer

public class KboatInterest
{
    public static void computeInterest(double p, double r, int t) {
        double amt = p * Math.pow(1 + (r / 100 ), t);
        double interest = amt - p;
        System.out.println("Compound Interest = " + interest);
    }
}

Output

BlueJ output of Write a program to calculate the compound interest.

Answered By

24 Likes


Related Questions