can anyone tell me why the "stop" command does not work?
package payroll;
import java.util.Scanner;
public class Payroll {
public static void main( String[] args )
{
Scanner input = new Scanner( System.in );
String name;
double wage;
int hours;
double pay;
System.out.print( "Welcome to the Payroll Calculator\n\n" );
System.out.print( "Enter the employee's name: " );
name = input.nextLine();
while (name.compareTo("stop") != 0 )
{
System.out.print( "Enter the employee's wage: " );
wage = input.nextDouble();
System.out.print( "Enter the number of hours worked: " );
hours = input.nextInt();
pay = wage * hours;
System.out.printf( "\n\nName: %s\nWage: $%.2f\nHours worked: %d\nPay: $%.2f\n", name, wage, hours, pay );
System.out.print( "Enter the employee's name: " );
name = input.nextLine();
}
}
}
