Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Первая версия программы #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MrGriv
Copy link

@MrGriv MrGriv commented Nov 2, 2023

No description provided.

Comment on lines +27 to +39
System.out.println("Введите сумму вклада в рублях:");
depositAmount = scanner.nextInt();
System.out.println("Введите срок вклада в годах:");
depositPeriod = scanner.nextInt();
System.out.println("Выберите тип вклада, 1 - вклад с обычным процентом, 2 - вклад с капитализацией:");
command = scanner.nextInt();
if (command == 1) {
amountWithPercents = calculateSimplePercent(depositAmount, yearRate, depositPeriod);
} else if (command == 2) {
amountWithPercents = calculateComplexPercent(depositAmount, yearRate, depositPeriod);
}
System.out.print("Результат вклада: " + depositAmount + " за " + depositPeriod);
System.out.print(" лет превратятся в " + amountWithPercents);

Choose a reason for hiding this comment

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

С 27 по 39 желательно выделить операции в отдельные логические блоки, иначе текст сливается и глаз хуже цепляется за отдельные элементы при первом прочтении. В данном случае это небольшой метод, но в достаточно сложных методах и если ты возвращаешься к этим методами спустя долгое время (> пол года) будет сложно читать и добавлять новый функционал в этот метод

Copy link
Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants