Skip to content

Проектная работа №1 - #1

Open
VirusDobra wants to merge 1 commit into
mainfrom
dev
Open

VirusDobra wants to merge 1 commit into
mainfrom
dev

Conversation

@VirusDobra

Copy link
Copy Markdown
Owner

Спасибо за замечания, становлюсь лучше

Comment thread src/main/java/Result.java
public class Result {
Calculator menuMany = new Calculator();
Friends kolVoPeople = new Friends();
double Finish(){

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 и kotlin

Comment thread src/main/java/Result.java
Calculator menuMany = new Calculator();
Friends kolVoPeople = new Friends();
double Finish(){
double zrachKa,peOple,reShala,celoe;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⏫ Также при нейминг переменных лучше придерживаться camelCase способа - каждое новое слово в названии пишется с большой буквы

Comment thread src/main/java/Result.java
}


/* double i = 4;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⏫ Лучше в итоговой версии удалять закомментированный код и лишние отступы


public class Friends {

boolean restart = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⏫ Переменная restart используется только в методе friends, поэтому нам не обязательно создавать как поле класса. Мы можем объявить ее лишь в поле friends

if (numberFriends.hasNextInt()) {
int number = numberFriends.nextInt();
if (number <=1 ){
System.out.print("Количество человек, равно 1. В этом случае нет смысла ничего считать и делить.\nВведите сколько вас гостей: ");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⏫ Комментарий по выводимому тексту пользователю: мы не уверены, что он ввел именно 1. Он также мог ввести 0 или отрицательное число

double Calculator() {

boolean restart = true;
String chek = " ", menu = " ", stop = "Завершить";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⏫ Обычно в нейминге переменных используются английские слова:

  • chek -> receipt
  • obshag -> common
  • many -> money

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