Skip to content

Проектная работа №1 "Калькулятор счёта" - #1

Open
MrMarkys wants to merge 2 commits into
devfrom
main
Open

MrMarkys wants to merge 2 commits into
devfrom
main

Conversation

@MrMarkys

Copy link
Copy Markdown
Owner

No description provided.

@@ -0,0 +1,19 @@
import java.util.Iterator;

public class Formating {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Formatting

Comment thread src/main/java/Main.java
scanner.nextLine();
}
}
scanner.close();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

В Main надо по хорошему только старотовать программу, а остальное выносить в отдельные сущности

static double price;
static double sumOfPrices;
static double sumForOne;
static short plugForCycle;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

тут много где private


} else {

do {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Много вложенности усложняет читаемость кода. Рекомендую разбить всю логику на отдельные не очень большие методы

}
} while (price <= 0);

Good good = new Good(nameGood, price);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Непонятно, зачем каждый раз создавать экземпляр класса Good, если у Good все поля static

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