Conversation
2.Fraction_Number->halfway -you can divide by 0 -no objects ONE/TEN
didva
left a comment
There was a problem hiding this comment.
Please add 3rd task, fix comments and format your code.
| public FractionNumber() { | ||
| } | ||
|
|
||
| public FractionNumber(int Numerator, int Denominator) { |
There was a problem hiding this comment.
Please read java convention. All variables, fields and method arguments should be named on lowerCamelCase.
|
|
||
|
|
||
| final int def = 1; | ||
| protected int Numerator; |
There was a problem hiding this comment.
Please move these fields on the top of the class.
| protected int Numerator; | ||
| protected int Denominator; | ||
|
|
||
| int a = Numerator; |
There was a problem hiding this comment.
Why do you need variables a, b?
| Ad = Ad * aN; | ||
| An = An * aD; | ||
| FractionNumber b = new FractionNumber(An, Ad); | ||
| b.Normalized(); |
There was a problem hiding this comment.
Normalization should be done right on object creation. So please move it to constructor.
| public FractionNumber(int Numerator, int Denominator) { | ||
| this.Numerator = Numerator; | ||
|
|
||
| if(Denominator==0){System.out.println("WRONG");} |
There was a problem hiding this comment.
System.out.println("WRONG"); is not the case. Please set denominator to 1 or throw exception.
| /** | ||
| * Created by User on 05.12.2016. | ||
| */ | ||
| public class Employees { |
There was a problem hiding this comment.
Employee is most likely better name for this class.
|
|
||
|
|
||
|
|
||
| protected String name; |
There was a problem hiding this comment.
Please move fields on the top of the class.
| * Created by User on 05.12.2016. | ||
| */ | ||
| public class Employees { | ||
| public Employees(String nameE,int workHoursE){ |
There was a problem hiding this comment.
Not sure it's a good way to pass worked hours via constructor. I'd prefer add method like work(int hours) or simple setWorkedHours(int hours).
| * Created by User on 05.12.2016. | ||
| */ | ||
| public class Accountant extends Employees { | ||
| private static int countAccountant; |
There was a problem hiding this comment.
There is no need to count all objects that were created.
| public Accountant(String nameE, int workHoursE) { | ||
| super(nameE, workHoursE); | ||
| countAccountant++; | ||
| Manager.SalaryOverAll=Manager.SalaryOverAll+getSalary(); |
There was a problem hiding this comment.
Accountant should contain array of employees and calculate their salary instead of static fields.
You should avoid static fields/methods everywhere it possible.
1.Employees-done
2.Fraction_Number->halfway
-you can divide by 0
-no objects ONE/TEN