Skip to content

Вторая попытка. ПР 1 - #1

Open
simsasha wants to merge 5 commits into
mainfrom
dev
Open

simsasha wants to merge 5 commits into
mainfrom
dev

Conversation

@simsasha

Copy link
Copy Markdown
Owner

Вторая попытка

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

public class newGoodGenerator { // Добавить с большой буквы; Классы в JAVA с большой буквы.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Да, классы в Java пишутся в PascalCase:)

Comment thread src/main/java/Main.java
@@ -1,6 +1,16 @@

public class Main {
int result;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Переменная объявляется, но нигде не используется

double totalPrice = 00.00;
public String allGoods = "Список всех товаров: " + "\n";

public String generateNewGood() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Этот метод возвращает строку, но при этом возвращаемое значение нигде не используется - метод просто вызывается без присваивания его переменной: generator.generateNewGood();. Лучше тогда сделать его void.

Comment thread src/main/java/Good.java
return goodCreated;
}

public double priceSet(double 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.

Этот метод возвращает строку, но при этом возвращаемое значение нигде не используется - метод вызывается, в нем происходит присваивание this.price = price;, после чего return this.price; в пустоту. Лучше сделать void и ничего не возвращать

Comment thread src/main/java/Good.java
return this.price;
}

public String nameSet(String name) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

То же самое

System.out.println(allGoods);
}

public String showTotalPrice() { // Метод показывает общую форму заказа;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Также return в пустоту

@simsasha

simsasha commented May 22, 2023 •

Copy link
Copy Markdown
Owner Author

@faritowich правки для вывода рубля внесены (196a8b3)

остальные комментарии проработаю когда закрою ЖД и направлю вторую ПР (24.05)

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