Hello,
I'm a bit new here, and also quite new to java. I'm wondering how I would insert a print statement into the do while loop, if the while is false.
do {
System.out.println("Enter number of years for the loan an in integer: ");
numberOfYears = input.nextDouble();
System.out.println("Enter the loan amount : ");
loanAmount = input.nextDouble();
} while (loanAmount <= 0 || numberOfYears <= 0) ;
I want System.out.println("Your numbers must be positive, please try again.");
if the while is false right before the code gets re-executed.
Also, how would I fit a % inside the following statement, since it's using specifier, it won't let me put another % sign that I need because it's a percent value!
System.out.printf(" %.3f" ,annualInterestRate);
Thanks!