I have to write an Employee Class, and then call it in Main to run the test items.
I keep getting "cannot resolve symbol" on a method, empRate. It exists in the Employee20 Class, but when I call the class and method from EmployeeMain20, I get a "cannot resolve symbol" error.
Net searching has given me all kinds of stuff about IntelliJ bugs, changing file pathways, and transferring projects, all of which just confuses me. IntelliJ was installed on this computer only, no files have been transferred or accessed from other sources, and creating a clean copy a location over didn't solve the problem.
This is the problematic code. The second "empRate" in each line is where I get "cannot resolve symbol".
Employee20 empRate = new empRate("John", "Smith", 10000, 10, 10);
Employee20 empRate1 = new empRate("Sue", "Smith", 20000, 10, 10);
Here is the full code for the calling class, EmployeeMain20:
public class EmployeeMain20 {
//Year added to differentiate from [other] assignments
public static void main(String[] args){
Employee20 empRate = new empRate("John", "Smith", 10000, 10, 10);
Employee20 empRate1 = new empRate("Sue", "Smith", 20000, 10, 10);
double wage = empRate.getWage();
System.out.println("Employee name: " + empRate1.firstName + empRate1.lastName);
System.out.println("Employee wage: " + "$" + wage);
//emp.greet();
System.out.println("===============================================");
wage = empRate1.getWage(); //wage defined in Employee2020 class
System.out.println("Employee name: " + empRate1.firstName + empRate1.lastName);
System.out.println("Employee wage: " + "$" + wage);
//emp.greet();
}
}
Here is the code for the class being called, Employee20:
public class Employee20 {
//Year added to differentiate from [other] assignments
String firstName, lastName;
int baseSalary, overtime, rate;
public double getWage(){
double wage = baseSalary * (overtime * rate);
return wage;
}
public void empRate(String fname, String lname, int base, int overTime, int unitrate){
firstName = fname;
lastName = lname;
baseSalary = base;
overtime = overTime;
rate = unitrate;
}
}
I'm having a similar problem on another assignment. I figure if I can find out how solve one, I can solve both.