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

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

Open
VirusDobra wants to merge 1 commit intomain from
dev
Open

Проектная работа No1 #1
VirusDobra wants to merge 1 commit intomain from
dev

Conversation

@VirusDobra
Copy link
Owner

@VirusDobra VirusDobra commented Jul 1, 2023

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

public class Result {
Calculator menuMany = new Calculator();
Friends kolVoPeople = new Friends();
double Finish(){
Copy link

@kirillNay kirillNay Jul 2, 2023

Choose a reason for hiding this comment

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

⏫ Лучше стараться называть все функции с маленькой буквы, такой принцип нейминга общепринятый в java и kotlin

Calculator menuMany = new Calculator();
Friends kolVoPeople = new Friends();
double Finish(){
double zrachKa,peOple,reShala,celoe;
Copy link

@kirillNay kirillNay Jul 2, 2023

Choose a reason for hiding this comment

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

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

}


/* double i = 4;
Copy link

@kirillNay kirillNay Jul 2, 2023

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

@kirillNay kirillNay Jul 2, 2023

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

@kirillNay kirillNay Jul 2, 2023

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

@kirillNay kirillNay Jul 2, 2023

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

VirusDobra reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@kirillNay kirillNay kirillNay approved these changes

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