/ Published in: Java
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
import java.util.*;
public class HourlyEmployee extends Employee {
// Data Objects (
private static final double OVERTIME_FACTOR = 1.5;
// )
// Constructors (
public HourlyEmployee() { //default
super();
}
super(f, l);
}
super(f, l);
}
public HourlyEmployee(EmployeeData d) { // basic info set, no payrate or hours
super(d);
}
public HourlyEmployee(HourlyEmployee e) { // copy
super(e.info());
}
// )
// Accessors (
}
}
// )
// Mutators (
if(hours.value() <= 40){
regHrs.set_value(hours);
}
else if(hours.value() > 40){
regHrs.set_value(40);
}
return regHrs;
}
if(hours.value() <= 40){
ovrHrs.set_value(0);
}
else if(hours.value() > 40){
ovrHrs = hours .minus (40);
}
return ovrHrs;
}
return regHours() .times (payRate()) .plus ( ovrHours() .times (OVERTIME_FACTOR) .times (payRate()) );
}
// )
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                