import java.util.*;
public class sSfive {
public static void main ( String[] args ) {
Scanner nix = new Scanner ( System.in );
System.out.print ( "Enter interest rate: " );
float inInt = nix.nextFloat;
System.out.println ( "" );
System.out.print ( "Enter number of year: " );
int inYear = nix.nextInt;
System.out.println ( "" );
System.out.print ( "Enter loan amount: " );
int inLoan = nix.nextInt;
System.out.println ( "" );
float mPay = ( inLoan*inInt ) / ( 1 - ( 1 / ( 1+inInt )*Math.pow( inYear*12 ) ) );
System.out.printf ( "Monthly payment = " + mPay" );
}
}
program that computes loan payments. The program lets the user enter the interest rate, number of years, and loan amount, and displays the monthly and total payments. The formula to compute the monthly payments is as follows:
montlyPayment=(loanAmount X monthlyInterestRate)/(1-(1/(1+monthlyInterestRate)numberOfYearsX12))
i need help with this one, i don't know how to use math class