i just tried
Code:
private double bonusPoints (){
return super.getSalary / 52.0 + bonusPoints * 20;
}
but it come up with the following error
Code:
SalesStaff.java:13: cannot resolve symbol
symbol : variable getSalary
location: class Employee
return super.getSalary / 52.0 + bonusPoints * 20;
^
i aslo tired this
Code:
return this.getSalary / 52.0 + bonusPoints * 20;
}
but this came up with following errror
Code:
SalesStaff.java:13: cannot resolve symbol
symbol : variable getSalary
location: class SalesStaff
return this.getSalary / 52.0 + bonusPoints * 20;
^
im very new to java please help
here is the emplyee classs
Code:
public class Employee {
//instance variables
private String fName;
private String sName;
private String payReference;
private double annualSalary;
//constructor
public Employee (String inputName, String inputSurname, String inputPayRef, double inputSalary)
{
fName = inputName;
sName = inputSurname;
payReference = inputPayRef;
annualSalary = inputSalary;
}
//The next 4 methods are ACCESSOR methods
public String getfName(){
return fName;
}
public String getsName(){
return sName;
}
public String getPayReference(){
return payReference;
}
public double getSalary(){
return annualSalary;
}
//The next 4 methods are SETTING methods
public void setName(String newName){
fName = newName;
}
public void setsName(String newsName){
sName = newsName;
}
public void setPayReference(String newPayRef){
payReference = newPayRef;
}
public void setSalary(double newSalary){
annualSalary = newSalary;
}
public void showDetails(){
System.out.println("Employee Name : " + this.getfName() );
System.out.println("Employee Surname : " + this.getsName() );
System.out.println("Pay Reference : " + this.getPayReference());
System.out.println("Annual Salary : £ " + this.getSalary());
}
}//End of class definition