-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #2
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
base: master
Are you sure you want to change the base?
Dev #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Рекомендация: файлы директорий .idea и build стоит вынести в .gitignore
src/main/java/Main.java
Outdated
|
|
||
| for (int i = 1; i <= 3; i++) { | ||
| System.out.println("Введите название машины №" + i + ": "); | ||
| Car.car = scanner.next(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь нужно создавать ноdый экземпляр класса : Car car = new Car(name, speed)
src/main/java/Main.java
Outdated
| while (true) { | ||
| System.out.println("Введите скорость машины №" + i + ": "); | ||
| Car.speed = scanner.nextInt(); | ||
| if ((Car.speed >= 0) & (Car.speed <= 250)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Критично: & - это побитовое И, здесь нужно логическое &&
src/main/java/Race.java
Outdated
|
|
||
|
|
||
| public static void nowLead(Car car) { | ||
| int distance = Car.speed * 24; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
здесь по сути идет проверка только по последней введенной скорости. Нужно взять 3 экземпляра авто(списком), пройтись по ним циклом и определить победителя
No description provided.