0

How do I stop this from looping over and over?

```
import java.text.DecimalFormat;
import java.util.Scanner;
public class Loan1 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double interest;
double payment;
double amount;
double term;
DecimalFormat decimalPlaces=new DecimalFormat("0.00");
while (true) { //keep looping until we see stop
System.out.println("Enter Interest: ");
interest = input.nextDouble();
term = -1;
while (term <= 0) {
System.out.println("Enter a positive term: "); // prompt
term = input.nextDouble(); // this requires positive number, or keeps asking
}
System.out.print("Type term: "); // prompt
amount = -1;
while (amount <= 0) {
System.out.println("Enter a positive amount: "); // prompt
amount = input.nextDouble(); // this requires positive number, or keeps asking
break;
}
interest = interest/12;//helps simplify the equation
payment = amount*((interest*(Math.pow((interest+1), term))))/(Math.pow((interest+1),term)-1);
input.nextLine();
} // end while
} // end main
}// endloan1
```