I have worked on this class all last night and I am having trouble finding the problem. When I compile this file I am recieving errors and I do not understand what is the problem. Here is the program code:
public class Employee
{
private String employeeName; //name of employee
private int hours; // when used double here errors occured.
private int rate;
private int pay;
// constructor to initialize employeeName
public Employee( String name )
{
employeeName = name; // initializes employeeName
} // end constructor
// method to set employee name
public void setEmployeeName( String name )
{
employeeName = name;
} // end method setEmployeeName
// method to set hours worked
public double setHours()
{
hours worked = hours;
} // end method setHours
// method to set wage rate
public double setRate()
{
wage rate = rate;
} // end method setRate
// method to retrieve employee name
public String getEmployeeName()
{
return employeeName;
} // end method getEmployeeName
// method to retrieve hours worked
public double getHours()
{
return hours;
} // end method getHours
// method to retrieve wage rate
public double getRate()
{
return rate;
} // end method getRate
// method to retrieve pay total
public double getPay()
{
return pay;
} // end method getPay
} // end Employee class
Here are the 2 errors that I am recieving from the compiler:
cannot find symbol
symbol : class hours
location : class Employee
hours worked = hours;
^
cannot find symbol
symbol : class rate
location : class Employee
wage rate = rate;
^
I do not know if I am overlooking something that I know to do because I am so tired or what. But I am not sure what symbol it can't find. Help would be appreciated.
Sincerely,