Skip to content

Conversation

@SL-TX
Copy link
Owner

@SL-TX SL-TX commented Oct 24, 2022

No description provided.


import java.util.Objects;

public class Tovar {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tovar --> Product

import ru.skypro.exceptions.WrongRightsException;

public class DriverD extends Driver{
public DriverD(String fio, Boolean haveRights, Integer stazh, Bus transport) throws WrongRightsException {
Copy link

@iStemmer iStemmer Nov 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stazh ---> experience


private List<Mechanic> mechanicList = new ArrayList<>();

private Driver driver;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут должен быть список всех всех потенциальных водетелей


Set<Product> setProducts = new HashSet<>();
private final String name;
public Integer SumCostProducts(){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SumCostProducts - метод большой буквы. lowerCamelCase

}

public void addToSet(Product val){
setProducts.add(val);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

проверка на то, что такой продукт существует?

public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Product product)) return false;
return Objects.equals(cost, product.cost) && Objects.equals(weight, product.weight);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сравнение по цене? Мне кажется это неправильно.

Random r = new Random();
int int1 = r.nextInt(7)+2;
int int2 = r.nextInt(7)+2;
uniqueQuestion.add(int1 + "*" + int2);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нет проверки на зеркальные примеры, например 34 и 43

Random r = new Random();
int int1 = r.nextInt(7)+2;
int int2 = r.nextInt(7)+2;
if (!uniqueQuestion.contains(int2 + "*" + int1)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нет проверки на зеркальный пример

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants