Posted By


trusktr on 11/19/10

Tagged


Statistics


Viewed 177 times
Favorited by 0 user(s)

cisp401 SalariedEmployee.java


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. import java.util.*;
  2.  
  3. public class SalariedEmployee extends Employee {
  4.  
  5. // Data Objects (
  6. public Number salary;
  7. // )
  8. // Constructors (
  9. public SalariedEmployee() {
  10. super();
  11. salary = new Number(0);
  12. }
  13. public SalariedEmployee(String f, String l, double sal) {
  14. super(f, l);
  15. salary = new Number(sal);
  16. }
  17. public SalariedEmployee(MyString f, MyString l, Number sal) {
  18. super(f, l);
  19. salary = new Number(sal);
  20. }
  21. public SalariedEmployee(EmployeeData d) {
  22. super(d);
  23. salary = new Number(0);
  24. }
  25. public SalariedEmployee(SalariedEmployee e) {
  26. super(e.info());
  27. salary = new Number(salary());
  28. }
  29. // )
  30. // Accessors (
  31. // )
  32. // Mutators (
  33. public Number salary() {
  34. return new Number(salary);
  35. }
  36. public Number grossPay() {
  37. return salary();
  38. }
  39. // )
  40. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.