Conversation
| * Project: oop.pr1 | ||
| */ | ||
| public class Accountant extends Employee { | ||
| private static int countAccountant; |
| return getRatioOfHours() * getSalary(); | ||
| } | ||
|
|
||
| public int overallSalary(Employee[] employees) { |
There was a problem hiding this comment.
I'd prefer to store array/list of employees in the field and do not pass them through argument.
| return getRatioOfHours() * getSalary(); | ||
| } | ||
|
|
||
| public int overallSalary(Employee[] employees) { |
There was a problem hiding this comment.
Why this method returns integer?
| } | ||
|
|
||
| public int overallSalary(Employee[] employees) { | ||
| double i = 0.; |
There was a problem hiding this comment.
i is not the best name for this purpose.
| } | ||
|
|
||
| @Override | ||
| public double calculateSalary() { |
There was a problem hiding this comment.
Why do you override method with exactly the same implementation? I'd prefer to make base method abstract.
| * Created by lbrdev on 04.01.2017. | ||
| * Project: oop.pr1 | ||
| */ | ||
| public class FractionNumberOperations { |
There was a problem hiding this comment.
Please move all these operations inside the FractionNumber class.
| } | ||
|
|
||
| public double decimalValue() { | ||
| return ((double) dividend) / ((double) divisor); |
There was a problem hiding this comment.
The only one cast will be enough.
| this.dividend = dividend; | ||
| this.divisor = DEFAULT_DIVISOR; | ||
| } else { | ||
| this.dividend = dividend; |
There was a problem hiding this comment.
There is no need to assign these fields. They will be overridden on the next few lines.
| } | ||
|
|
||
| private int gcd(int dividend, int divisor) { | ||
| int maxValue; |
There was a problem hiding this comment.
I'd prefer to assign values like:
int maxValue = dividend;
int minValue = divisor;
And remove one condition.
|
|
||
| public FractionNumber(int dividend) { | ||
| this.dividend = dividend; | ||
| this.divisor = 1; |
There was a problem hiding this comment.
Please use default value instead of 1
to check 1, 2