-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
done #1392
base: master
Are you sure you want to change the base?
done #1392
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on implementing the SalaryInfo
class! 🎉 Your code meets all the task requirements and constraints, and it's well-structured and readable. The only suggestion is to consider renaming the getSalesByName
method to something more descriptive like calculateSalariesByName
to better reflect its functionality. Keep up the excellent work and happy coding! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
String[] splitData = datum.split(" "); | ||
LocalDate dataNow = LocalDate.parse(splitData[0], formatter); | ||
if ((dataFrom.isBefore(dataNow) || dataFrom.isEqual(dataNow)) && (dataTo.isAfter(dataNow) || dataTo.isEqual(dataNow))) { | ||
getSalesByName(names, splitData, salariesByName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method name getSalesByName
is misleading as it suggests retrieving sales data, but it actually calculates salaries. Consider renaming it to something like calculateSalariesByName
to better reflect its purpose.
String[] data, | ||
String dateFrom, | ||
String dateTo) { | ||
final DateTimeFormatter formatter = DateTimeFormatter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make it class-level constant
private static void calculateSalariesByName(String[] names, | ||
String[] splitData, | ||
int[] salariesByName) { | ||
for (int j = 0; j < names.length; j++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can give me a small hint how i can reduse loops count? Cuz i honestly have no idea how to remove one of that loops
int[] salariesByName) { | ||
for (int j = 0; j < names.length; j++) { | ||
if (splitData[1].equals(names[j])) { | ||
int countOfHours = Integer.parseInt(splitData[2]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's create constants for all magic numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You say about numbers 1 and 2?
No description provided.