Guest User

Untitled

a guest
Jun 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. while (monthlyPayment < lowPayment && !warning)
  2.         {
  3.             System.out.print("The monthly payment amount entered is possibly low, furthermore, this might cause a high amount of payments. "
  4.                 + "\nIs this fine? Y for Yes, N for No: ");
  5.             userInput = keyboard.next();
  6.            
  7.             if (userInput.equalsIgnoreCase("Y"))
  8.             {
  9.                 warning = true;
  10.             }
  11.             else
  12.             {
  13.                 System.out.print("\nPlease enter monthly payment amount: ");
  14.                 monthlyPayment = keyboard.nextDouble();
  15.                
  16.                 while (monthlyPayment < 0)
  17.                     {
  18.                         System.out.print("Invalid entry for monthly payment amount. Please enter monthly payment amount: ");
  19.                         monthlyPayment = keyboard.nextDouble();
  20.                     }
  21.             }
  22.         }
  23.        
  24.         return monthlyPayment;
Add Comment
Please, Sign In to add comment