Originally Posted by
iamgonge
I cant figure out this damn line of code please help me!!!!!!
In which PMT is the monthly payment, P is the listed price of the house, D is the
down payment, r is the annual interest rate and m is the number of payments.
pmt = ((p-d)*r/12) / (1-(1+(r/12)^-m)
this is my code
import java.util.Scanner;
public class Project1 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter the price of the house: ");
double housePrice = input.nextDouble();
System.out.println("Enter the down payment: ");
double downPayment = input.nextDouble();
System.out.println("Enter the annual interest rate: ");
double annualInterestRate = input.nextDouble();
System.out.println("Enter the number of payments: ");
double numberofPayments = input.nextDouble();
double monthlyPayment= ( ((housePrice - downPayment) * (annualInterestRate/12)) /((1-(1+(annualInterestRate/12)))));//<---this is where im stuck how do i enter the negative m into this equation where do i put the math.pow. Please for the love of god throw me a bone ive been stuck on this for two hours now
}
Please don't post the same question more than once. This needless splitting of the discussion is not fair to the volunteers who work this forum and is against forum rules which
you agreed to on joining. Keep this up and we'll have no choice but to ban you. You've received one warning.
Locking this thread as a duplicate.