title: While loop problems in Java
body: <p>I am having trouble with my while loop. After it executes the third time, it won't take user input it just outputs "Enter your first name". I have tried multiple things but they don't seem to be working. The loop should continue to run until the user types in "No".</p>
  
  <p>I know I'm close!</p>
  
  <pre><code>System.out.print("Would you like to enter another patient? Type Yes or No: ");
  String userInput = input.nextLine();
  if (userInput.equals("Yes")) 
  {
      while (userInput.equals("Yes")) 
      {
          System.out.print("Enter your first name: ");
          String firstName2 = input.nextLine();
          System.out.print("Enter your last name: ");
          String lastName2 = input.nextLine();
          System.out.print("Enter your address: ");
          String address2 = input.nextLine();
          System.out.print("Enter your city: ");
          String city2 = input.nextLine();
          System.out.print("Enter your state: ");
          String state2 = input.nextLine();
          System.out.print("Enter your zip code + 4: ");
          String zip2 = input.nextLine();
          System.out.print("Enter amount owed: ");
          String amount2 = input.nextLine();
          System.out.print("Enter your payment amount: ");
          String payment2 = input.nextLine();
          System.out.print("Enter the date of payment: ");
          String date2 = input.nextLine();
          System.out.println("\t\t\t\t\t" + "XYZ Hospital");
          System.out.println();
          System.out.println("Name Information" + "\t\t\t\t" + "Address" + "\t\t\t\t\t\t" + "Payment");
          System.out.println();
          System.out.println("Last" + "\t" + "First" + "\t\t\t" + "Address Line 1" + "\t" + "City" + "\t" + "State" + "\t" + "Zip" + "\t" + "Amount Owed" + "\t" + "Payment Amount" + "\t" + "Payment Date");
          System.out.println();
          System.out.println(lastName2 + " " + firstName2 + "\t" + address2 + " " + city2 + ", " + state2 + " " + zip2 + "\t" + amount2 + "\t\t" + payment2 + "\t\t" + date2);
          System.out.print("Would you like to enter another patient? Type Yes or No: ");
      }
  }
  else if (userInput.equals("No")) 
  {
      System.out.println("Goodbye");
  }
  </code></pre>