This code is riddled with problems.
For starters, half of your while() loops have semicolons after them!
while (payrate < 0); for example
next, you declare string employeename with string in lowercase, it should be uppercase. Also, you later refer to employeeName and name, neither of which (Java is case sensitive!)
you also refer to a nonexistent payrate variable, which I assume is hourlyPayRate
you call scanner.nextline(), it should be nextLine()
your while loop while(employeeName.equalsIgnoreCase("stop")) is, I assume, supposed to keep going until the employeeName is stop, in which case you want to add == false. So it keeps going while it isn't stop.
you prompt for employeename 3 times!
your System.printf() statement is broken.
also, you have an extra curly brace at the end.
Here's good practice, always name variables (as well as methods) lowercase, with words separated by capitalization. employeeName for example, or hourlyPayRate, having a standard keeps you from messing up capitalization.
I refactored the code and corrected some things, here it is:
CODE
//Annette Turner
//Payroll2.java
//Program that displays employee pay
import java.util.Scanner;//program uses class Scanner
public class Payroll2
{
// main method begins execution of java application
public static void main(String args[])
{
String employeeName;// name of employees
double hourlyPayRate;// employee's hourly rate
double hoursWorked;// employee's weely work hours
double weeklyPay;// employee's 40 hour pay
// create Sanner to obtain input from command window
Scanner input= new Scanner(System.in);
employeeName= "";
// while statement
while(employeeName.equalsIgnoreCase("stop") == false)
{
// prompt for employeeName
System.out.print(" Please enter name(Input 'Stop' when finished)");
employeeName= input.next();
// prompt for and input hourlypayrate
System.out.print(" Enter hourlypayrate: ");
hourlyPayRate= input.nextDouble();// obtain user input
// while statment
while(hourlyPayRate < 0)
{
System.out.print(" Please enter postive amount: ");
hourlyPayRate= input.nextDouble();
}// End while loop (" hourlypayrate");
// prompt for and input hoursworked
System.out.print(" Enter hoursworked: ");
hoursWorked= input.nextDouble();// obtain user input
// while statement
while(hoursWorked < 0)
{
System.out.print(" Please enter postive amount: ");
hoursWorked= input.nextDouble();
}// End while loop (" hoursworked ");
// calculate weeklypay
weeklyPay= hourlyPayRate * hoursWorked;
// display employeename and weeklypay
System.out.println("weeklypay for " + employeeName + " is " + weeklyPay + "\n");
}// End whileloop
} // End main method
} // End class Payroll2