Created
January 14, 2012 03:25
-
-
Save coderunner/1610120 to your computer and use it in GitHub Desktop.
Wrap with functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SalaryOperation { | |
| private final Employee employee; | |
| public SalaryOperation(Employee employee) { | |
| this.employee = employee; | |
| } | |
| public int computeBonus(float factor) { | |
| return Math.round(employee.salary * factor * employee.targetBonus); | |
| } | |
| public int getWeeklySalary() { | |
| return Math.round(employee.salary / 52f); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment