Right now I'm having a problem getting my program to run, it compiles with no errors. The only previous error I had was that it stated reached end of file while parsing which I think I fixed. Can anyone help me?

import java.util.Scanner;


public class Payyroll2
{
    public static void main( String[] args )
    {

        Scanner input = new Scanner( System.in );

            String EmployeeName;
            double hourpay; // hourly wages entered
            double hoursworked; // number of hours worked entered
            double weeklypay; // calculates weekly pay
            boolean end = false; // is the input name stop
            while (end = false)
            {

            hourpay = -1; // both initiated to be -1;
            hoursworked = -1;
            System.out.print("Enter employee name:" ); //Requests employee name
            EmployeeName = input.nextLine();
            if(EmployeeName.toLowerCase().equals("stop"))
            {

                end = true;  
            }

            {
            System.out.print( "Enter Hourly Wage:" ); //Asks for wages
            hourpay = input.nextDouble(); // States wages entered

            while (hoursworked < 0) // hourly 


            System.out.print( "Enter hours worked:" ); // asks for hours
            hoursworked = input.nextDouble(); //States hours worked
            }

            System.out.print("Weekly Salary is: $" + hourpay*hoursworked);
            weeklypay=input.nextDouble();

        }   
        } // end method main
    } // end 

Edited 2 Years Ago by Siick7

The error I recieve after I changed it was illegal start of expression

 if(EmployeeName.toLowerCase().equals("stop"))
{
end = true;
}

replace this by:
end = EmployeeName.toLowerCase().equals("stop");

you should indent your code more properly, and re-think all the opening and closing brackets.

if(EmployeeName.toLowerCase().equals("stop"))
{
end = true;
}
{ // -> this makes little sense to me.

also, try and follow naming conventions, it 'll make your code easier to read.
if you followed oussama's recommendation, it could not lead to an illegal expression error. what did you change?

This article has been dead for over six months. Start a new discussion instead.