Skip to content

Task2#787

Open
quperino wants to merge 6 commits intoKFalcon2022:masterfrom
quperino:Task2
Open

Task2#787
quperino wants to merge 6 commits intoKFalcon2022:masterfrom
quperino:Task2

Conversation

@quperino
Copy link

No description provided.

@KateKhodko KateKhodko self-assigned this Dec 26, 2024
@quperino
Copy link
Author

Что-то не так кодом?

// Константы
final int FLAT_AMOUNT_ON_ONE_FLOOR = 4;
final int FLAT_AMOUNT_ON_ONE_HOUSE = floorAmount * entranceAmount * FLAT_AMOUNT_ON_ONE_FLOOR;
final int FLAT_AMOUNT_ON_ONE_ENTRANCE = floorAmount * FLAT_AMOUNT_ON_ONE_FLOOR;
Copy link
Collaborator

Choose a reason for hiding this comment

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

FLAT_AMOUNT_ON_ONE_HOUSE и FLAT_AMOUNT_ON_ONE_ENTRANCE лучше сделать локальными переменными

Copy link
Author

Choose a reason for hiding this comment

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

Исправил


return null; // Заглушка. При реализации - удалить
// Константы
final int FLAT_AMOUNT_ON_ONE_FLOOR = 4;
Copy link
Collaborator

Choose a reason for hiding this comment

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

сюда добавить private

Copy link
Author

Choose a reason for hiding this comment

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

Возможно, что-то неправильно понял, но добавить на дает
изображение


// Проверка на входные данные
if (flatNumber > FLAT_AMOUNT_ON_ONE_HOUSE) {
return "Takoi kvartiry ne seschestvuet.";
Copy link
Collaborator

Choose a reason for hiding this comment

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

весь текст написать как в примере, на русском, иначе не пройдут тесты

Copy link
Author

Choose a reason for hiding this comment

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

Исправил весь текст на кириллицу

return flatNumber + " kv - " + entranceNumber + " pod_ezd, " + floorNumber + " etazh, " + flatLocationOnAFloor;
}
}
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

В конце файла по правилам оформления нужно оставлять пустую строку)

Copy link
Author

Choose a reason for hiding this comment

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

Добавил

int flatNumberEquivalent = flatNumber;
int entranceNumber = 1;

// Если квартира расположена не в первом подъезде
Copy link
Collaborator

Choose a reason for hiding this comment

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

Необязательно оставлять так много комментариев, хороший код будет понятным и без них)
Комменты оставляем только в самом крайнем случае в местах с сложной логикой

Copy link
Author

Choose a reason for hiding this comment

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

Ок, убрал

@quperino quperino requested a review from KateKhodko December 27, 2024 01:18
@quperino quperino marked this pull request as draft January 13, 2025 18:30
@quperino quperino marked this pull request as ready for review January 13, 2025 18:31
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

Comments