I'm getting a error code : java:23: error: cannot find symbol
monthlyPayment=(balance*(interest/12))/(1-(Math.pow(1/(1+(interest/12)),(numberOfYears*12))));
^
symbol: method pow(double,int)
location: class Math
1 error
it's pointing at Math.pow, but I dont understand what else to do thank you for any help.
import java.util.*;
public class Loan
{
public static void main(String[] args)
{
Scanner input= new Scanner (System.in);
double monthlyPayment=0;
double principal=0;
System.out.println("Loan Amount : ");
double balance=input.nextDouble();
System.out.println("Number of Years : ");
int numberOfYears=input.nextInt();
System.out.println("Annual Interest Rate : ");
double interest=input.nextDouble();
double monthlyInterestRate=interest/12;
interest= monthlyInterestRate *balance;
monthlyPayment=(balance*(interest/12))/(1-(Math.pow(1/(1+(interest/12)),(numberOfYears*12))));
for (int i=1; i<=numberOfYears *12; i++)
{
//interest= monthlyInterestRate *balance;
//monthlyPayment=(balance*(interest/12))/(1-(Math.pow(1/(1+(interest/12)),(numberOfYears*12))));
principal = monthlyPayment - interest;
balance= balance - principal;
System.out.println(i + "\t\t" + interest
+"\t\t" + principal + "\t\t" + balance);
}
}
}