KnowledgeBoat Logo

Computer Applications

A certain amount is invested at the rate 10% per annum for 3 years. Find the difference between Compound Interest (CI) and Simple Interest (SI). Write a program to take amount as an input.
Hint: SI = (P * R * T) / 100
         A = P * (1 + (R/100))T
         CI = A - P

Java

Input in Java

128 Likes

Answer

import java.util.Scanner;

public class KboatInterestDifference
{
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        System.out.print("Enter Amount: ");
        double p = in.nextDouble();
        double si = p * 10 * 3 / 100;
        double ciAmt = p * Math.pow(1 + (10/100.0), 3);
        double ci = ciAmt - p;
        System.out.print("Difference between CI & SI: " + (ci - si));
    }
}

Variable Description Table

Program Explanation

Output

BlueJ output of A certain amount is invested at the rate 10% per annum for 3 years. Find the difference between Compound Interest (CI) and Simple Interest (SI). Write a program to take amount as an input. Hint: SI = (P * R * T) / 100 A = P * (1 + (R/100)) T CI = A - P

Answered By

53 Likes


Related Questions