Not able to enter user input on second run of while loop <p>I'm writing a small payroll program with 2 classes (Payroll/contains main, and Employee). The program should continue to ask for user input until the user enters <em>stop</em> as an employee's name. I was able to get the program to terminate after entering <em>stop</em> as the first employee's name; however, when I input an actual name (for example Jim), the program runs through the while loop once fine. The problem is that when the while loop runs again it does not allow any user input for the employee name. It jumps directly to the next line, which is asking for hours worked. Here is my code from the Employee class.</p> <p>package payroll;</p> <p>import java.util.Scanner;</p> <p>public class Employee {</p> <pre><code>// class variables private String employeeName; private double hoursWorked; private double payRate; private double weeklyPay; // Employee class constructor public Employee() { } // get value of class variable employeeName from user public void getInfo() { String name = ""; // initialized as empty string for use in while loop String term = "stop"; // terminating condition for while loop double hours; // employee hours worked double rate; // employee pay rate Scanner input = new Scanner(System.in); while (!name.equals(term)) { // will continue as long as name does not equal "stop" System.out.print("Enter the employee's name or stop if finished: "); name = input.nextLine(); // assigns the value input for name employeeName = name; if (employeeName.equals(term)) break; // terminate while loop if user enters "stop" System.out.print("How many hours did " + employeeName + " work? "); hours = input.nextDouble(); // assigns the value input for hours hoursWorked = hours; // assigns hours to Employee class variable hoursWorked if (hours &lt; 0) { // control statement to make sure hours is not a negative number System.out.print("Hours cannot be a negative number.\n"); System.out.print("How many hours did " + employeeName + " work? "); hours = input.nextDouble(); // assigns the value input for hours hoursWorked = hours; // assigns hours to Employee class variable hoursWorked } System.out.print("Enter " + employeeName + "'s pay rate: "); rate = input.nextDouble(); // assigns the value input for rate payRate = rate; // assigns rate to Employee class variable payRate if (rate &lt; 0) { System.out.print("Rate cannot be a negative number.\n"); System.out.print("Enter " + employeeName + "'s pay rate: "); rate = input.nextDouble(); // assigns the value input for rate payRate = rate; // assigns rate to Employee class variable payRate } // calculates employee pay form calcPay method calcPay(); // outputs message to console displayMessage(); } } </code></pre> <p>public void calcPay() {</p> <pre><code> weeklyPay = setHours() * setRate(); } </code></pre> <p>public void displayMessage() {</p> <pre><code> System.out.printf("%s%s%.2f \n", employeeName, "'s weekly pay is $", weeklyPay); } </code></pre> <p>This is what my output looks like:</p> <p>Enter the employee's name or stop if finished: Tim</p> <p>How many hours did Tim work? 40</p> <p>Enter Tim's pay rate: 20.50</p> <p>Tim's weekly pay is $820.00</p> <p>Enter the employee's name or stop if finished: How many hours did work? </p> <p>I can't understand why I am not enter a new employee's name.</p>