import java.util.*;
class CompoundInterest
{
public static void main()
{
Scanner s = new Scanner(System.in);
System.out.println("Enter Principal Amount");
float p = s.nextFloat();
System.out.println("Enter Time Period i.e. number of years");
float t = s.nextFloat();
System.out.print("Enter Rate of Interest");
float r = s.nextFloat();
float a = p * (Math.pow(((1+ (r/100))), t));
float ci = a-p;
System.out.println("Compound Interest = " +ci);
System.out.println("Amount = " +a);
}
}
我收到这样的错误:
精度损失
必需:浮动
发现:双
1 个错误