Skip to content

Никита Филипенко, Когорта 12, Консольное приложение №1 - #1

Open
Swart03 wants to merge 6 commits into
mainfrom
dev
Open

Swart03 wants to merge 6 commits into
mainfrom
dev

Conversation

@Swart03

@Swart03 Swart03 commented Aug 30, 2023

Copy link
Copy Markdown
Owner

No description provided.

@ArturNurtdinov ArturNurtdinov left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Хорошая работа!

}

void printProductList(int people) {
String roundedPrice = PriceFormat.roundPrice(productListPrice / people);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Лучше добавить проверку параметра people, чтобы случайно не поделить на 0, если в будушем эту функцию будет кто-то переиспользовать

void printProductList(int people) {
String roundedPrice = PriceFormat.roundPrice(productListPrice / people);
System.out.println(productList.toString());
System.out.println("С каждого человека " + roundedPrice+ " " + PriceFormat.rubInflection(productListPrice / people));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

productListPrice / people можно посчитать 1 раз, записать результат в переменную и ей пользоваться

@@ -0,0 +1,24 @@
import java.util.Scanner;

public class PeopleAmount {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Я бы назвал класс PeopleAmountReader, так будет понятнее, за что он отвечает

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.

2 participants