A certain amount is invested at the rate of 10% per annum for 3 years.
Write a program to take amount as an input from the user. Calculate and
display the Amount, Simple Interest and Compound Interest also find the
difference between Compound Interest (CI) and Simple Interest (SI).
Hint:
SI = (P * R * T) / 100
A = P * (1 + (R/100)) T
CI = A – P
Answers
Answer:
Explanation:A businessman wishes to accumulate 3000 shares of a company. However, he already has some shares of that company valuing ₹10 (nominal value) which yield 10% dividend per annum and receive ₹2000 as dividend at the end of the year. Write a program in Java to calculate the number of shares he has and how many more shares to be purchased to make his target.
Hint: No. of share = (Annual dividend * 100) / (Nominal value * div%)
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));