Skip to content

Instantly share code, notes, and snippets.

@coderunner
Created January 14, 2012 02:34
Show Gist options
  • Select an option

  • Save coderunner/1610005 to your computer and use it in GitHub Desktop.

Select an option

Save coderunner/1610005 to your computer and use it in GitHub Desktop.

Revisions

  1. coderunner revised this gist Jan 14, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Employee.java
    Original file line number Diff line number Diff line change
    @@ -28,4 +28,4 @@ public void setName(String name) {
    this.name = name;
    }

    //...other getters and setters
    //...then other getters and setters
  2. coderunner revised this gist Jan 14, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Employee.java
    Original file line number Diff line number Diff line change
    @@ -28,4 +28,4 @@ public void setName(String name) {
    this.name = name;
    }

    ...
    //...other getters and setters
  3. coderunner created this gist Jan 14, 2012.
    31 changes: 31 additions & 0 deletions Employee.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    public class Employee {

    private String name;
    private int age;
    private int salary;
    private float targetBonus;

    public Employee()
    {}

    public int computeBonus(float factor) {
    return Math.round(salary * factor * targetBonus);
    }

    public int getWeeklySalary() {
    return Math.round(salary / 52f);
    }

    public boolean isEligibleForBenefits() {
    return age > 50;
    }

    public String getName() {
    return name;
    }

    public void setName(String name) {
    this.name = name;
    }

    ...