Where to give values if
P=1000
R=10%
T=2 years
import java.util.Scanner;
class CI {
public static void main(String] args) {
// create an object of Scanner class
Scanner input = new
Scanner(System.in);
// take input from users
System.out.print("Enter the principal: ");
double principal = input.nextDouble()System.out.print("Enter the rate: ");
double rate =
input.nextDouble();
System.out.print("Enter the time: ");
double time =
input.nextDouble();
System.out.print("Enter number of
times interest is compounded: ");
int number = input.nextInt();
double interest = principal *
(Math.pow(1 + rate/100), (time * number))
- principal;System.out.printIn("Principal: "+principal);
System.out.printIn("Interest Rate: " +rate);
System.out.printIn("Time Duration:
time);
+
System.out.printIn("Number of Time
interest Compounded: "+ number);
System.out.printIn("Compound Interest:
+ interest);
input.close();
}
}
Answers
Answered by
0
Answer:
The values of P,R,T have to be given in the console.
Explanation:
execute the program and open the console or terminal. It will print the lines i.e Enter principal...
Give the values accordingly
Similar questions