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 エラー