Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

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```

}

Originally Posted by iamgonge

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.