I am trying to get this finished, but it seems everything I do to fix it, I get even more errors. Please help me figure this out, I am having a lot of problems with this particular program. Below is my program and build errors, can someone let me know what I am doing wrong?

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//payroll program3;
/**
*
* @author Melissa
*/
public class PayrollProgram3
{


/**
* @param args the command line arguments
*/
public static void main(String[] args) {


}


}
// main begin payroll application



Scannersc input = new Scanner(System.in);
Employee Employees= new Employee();


double(payRate)
double (hoursWorked)
double (Ratepayed)


while (true)


System.out.println(Enter Employee Name):
Employee.setName(input.next):


if (Employee.Name().ignore("Stop"))



System.out.print ("Enter Employee PayRate);
Employees.setPayRate(input.nextDouble);


while (Employee.payRate() <= 0)



// Loop until valid number is entered for payrate: while (setpayRate < 0.0)
// end while


System.out.print ("Enter # of hours worked: ");
Employee.sethoursWorked(input.nextDouble);
while (Employee.gethoursWorked() <= 0 )



System.out.println ("Invalid amount);


System.out.print ("Please enter hoursWorked: ");
}    Employee.sethoursWorked(input.nextDouble());


System.out.printf("%s's weekly earned is:$%.3f\n");
}
/*Employee.getpayRate*/


/* Employee.getName*/
/*Employee.gethours Worked*/



} end while (true)



}end (main)



}//end class PayrollProgram3


init:
deps-jar:
Compiling 1 source file to C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\build\classes
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:27: class, interface, or enum expected
Scannersc input = new Scanner(System.in);
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:28: class, interface, or enum expected
Employee Employees= new Employee();
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:30: class, interface, or enum expected
double(payRate)
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:42: unclosed string literal
System.out.print ("Enter Employee PayRate);
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:45: class, interface, or enum expected
while (Employee.payRate() <= 0)
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:54: class, interface, or enum expected
Employee.sethoursWorked(input.nextDouble);
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:55: class, interface, or enum expected
while (Employee.gethoursWorked() <= 0 )
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:58: unclosed string literal
System.out.println ("Invalid amount);
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:61: class, interface, or enum expected
}    Employee.sethoursWorked(input.nextDouble());
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:63: class, interface, or enum expected
System.out.printf("%s's weekly earned is:$%.3f\n");
C:\Users\Melissa\Documents\NetBeansProjects\Week4Homework\src\PayrollProgram3.java:64: class, interface, or enum expected
}
11 errors
BUILD FAILED (total time: 0 seconds)

Edited 3 Years Ago by happygeek: fixed formatting

Yeah. You have your brackets in the wrong place.

public class PayrollProgram3
{

public static void main(String[] args) {

}
}

That's two open brackets and two closed brackets. Since the brackets match, you have no code in your main method, and no code in your class.

Yeah. You have your brackets in the wrong place.

public class PayrollProgram3
{

public static void main(String[] args) {

}
}

That's two open brackets and two closed brackets. Since the brackets match, you have no code in your main method, and no code in your class.

So the two brackets go in at the end of the code?

The brackets tell you what code belongs to what method.

public class Whatever{
}

^ Anything between the brackets in bold is code inside of the class.

public class Whatever{

public void main(String[] args){

}
}

^Anything inside the brackets in bold is code that belongs to the main method. (So when you run the main method, the code between those brackets gets executed).

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