Skip to content

1#1

Open
jzsns1 wants to merge 1 commit intomainfrom
dev
Open

1#1
jzsns1 wants to merge 1 commit intomainfrom
dev

Conversation

@jzsns1
Copy link
Copy Markdown
Owner

@jzsns1 jzsns1 commented Dec 2, 2025

pr1

String input = scanner.nextLine();
if (vNumber(input)) {
speed = Integer.parseInt(input);
if (speed > 0 && speed <= 250){
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Минимальную и максимальную скорости лучше вынести в константы для повышения читабельности кода

}
System.out.println("Самой быстрой оказалась машина - " + race.lName());
}
private static boolean vNumber(String input) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Функцию, проверяющую, является ли строка числом, лучше назвать isDigit или isNumber

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