Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Консольное приложение No1#1

Open
DanilaLort wants to merge 4 commits intomain from
dev
Open

Консольное приложение No1 #1
DanilaLort wants to merge 4 commits intomain from
dev

Conversation

@DanilaLort
Copy link
Owner

@DanilaLort DanilaLort commented Feb 10, 2024

Моя реализация консольного приложения: «Калькулятор счёта»

}
}

public static class Product {
Copy link

@taikonavt taikonavt Feb 12, 2024

Choose a reason for hiding this comment

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

Молодец, что добавил класс Product. Но на счет методов printAdd() и print() я бы подумал. Это все таки вывод текста в консоль, а класс Product должен содержать только логику относящуюся к product. Можно было бы например сделать метод
public void getStringProductWasAdd() { return "Блюдо: " + name + " по цене " + price + " рублей" + " добавленно"; } и в процессе выполнения программы вызвать System.out.println(getStringProductWasAdd()). Но это не сильно важно, просто на подумать.

Copy link

@taikonavt taikonavt Feb 12, 2024

Choose a reason for hiding this comment

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

Принцип единственной ответственности https://habr.com/ru/companies/ruvds/articles/426413/

System.out.println("Программа завершена");
return;
}
if (s.matches("\\d+")) {
Copy link

@taikonavt taikonavt Feb 12, 2024

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

Reviewers

1 more reviewer

@taikonavt taikonavt taikonavt left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /