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

Final version. Cosmetic changes2#115

Closed
manualcheg wants to merge 1 commit intoYandex-Practicum:master from
manualcheg:master
Closed

Final version. Cosmetic changes2 #115
manualcheg wants to merge 1 commit intoYandex-Practicum:master from
manualcheg:master

Conversation

@manualcheg
Copy link

@manualcheg manualcheg commented Nov 2, 2022

Приложение работает.
Выполняются все требования задания.
Реализовано 2 класса: Main, calc.

public static void input(int numberOfFriends) {
Scanner scanner = new Scanner(System.in);
String roubles;
String[] product = new String[100];
Copy link

@faritowich faritowich Nov 3, 2022

Choose a reason for hiding this comment

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

В данном случае ввод ограничен 100 товарами, после чего программа завершится. Скорее всего до 100 товаров не дойдет, но лучше подстраховаться и использовать ArrayList

Copy link
Author

@manualcheg manualcheg Nov 3, 2022

Choose a reason for hiding this comment

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

Хотелось выполнить работу соответственно уровню знаний, которые нам дали.
Формально ни массивы, ни arrayList нам неизвестны.
Но со строковой переменной не хотелось, хотя и разобрался, как это можно было.

Ну и, да, в реальности выполнения программы до 100 товаров никто не доберётся. Впрочем, как и в жизни :)

Спасибо за ревью!

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

public class calc {
Copy link

@faritowich faritowich Nov 3, 2022

Choose a reason for hiding this comment

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

Классы в Java принято называть с большой буквы
Про конвенции названий можно почитать здесь: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html

Copy link
Author

@manualcheg manualcheg Nov 3, 2022

Choose a reason for hiding this comment

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

да, понял, что ошибся только перед pull request'ом :(


System.out.println("Программа \"Калькулятор счёта\"");
numberOfFriends = inputOfFriends();
calc.input(numberOfFriends);
Copy link

@faritowich faritowich Nov 3, 2022

Choose a reason for hiding this comment

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

Можно запустить программу одной строчкой
calc.input(inputOfFriends());

Copy link
Author

@manualcheg manualcheg Nov 3, 2022

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

@faritowich faritowich faritowich 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 によって変換されたページ (->オリジナル) /