From 0e66dad50725fe10390553d7ac8a38038cc9e3a6 Mon Sep 17 00:00:00 2001 From: IFeelLikeGod <148801740+IFeelLikeGod@users.noreply.github.com> Date: Mon, 5 Jan 2026 17:46:39 +0000 Subject: [PATCH 1/4] Race Project number two --- VelocityOfCars.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VelocityOfCars.java b/VelocityOfCars.java index 1fec7378..76c7ce5a 100644 --- a/VelocityOfCars.java +++ b/VelocityOfCars.java @@ -28,7 +28,7 @@ public static void main(String[] args) { Car winner = Race.winner(cars); if (winner == null) { - System.out.println("Нет машин с допустимой скоростью (0..250)."); + System.out.println("Нет машин с допустимой скоростью. Допустимая скорость от 0 до 250"); } else { System.out.println("Самый быстрый автомобиль: " + winner.name); From 2d42dfaaa9e75109bac11f0d001725908fc6ad34 Mon Sep 17 00:00:00 2001 From: IFeelLikeGod <148801740+IFeelLikeGod@users.noreply.github.com> Date: Tue, 6 Jan 2026 09:40:13 +0000 Subject: [PATCH 2/4] Project 1, attempt 3 --- projectNumberOne.java | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 projectNumberOne.java diff --git a/projectNumberOne.java b/projectNumberOne.java new file mode 100644 index 00000000..76c7ce5a --- /dev/null +++ b/projectNumberOne.java @@ -0,0 +1,64 @@ +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + int n = 3; + + + Car[] cars = new Car[n]; + + for (int i = 0; i < n; i++) { + System.out.println("Введите название машины №" + (i + 1) + ":"); + String name = scanner.nextLine(); + + double velocity; + while (true) { + System.out.println("— Введите скорость машины №" + (i + 1) + ":"); + velocity = scanner.nextDouble(); + scanner.nextLine(); + + if (velocity >= 0 && velocity <= 250) break; + System.out.println("Неправильная скорость"); + } + + cars[i] = new Car(name, velocity); + } + + Car winner = Race.winner(cars); + + if (winner == null) { + System.out.println("Нет машин с допустимой скоростью. Допустимая скорость от 0 до 250"); + } else { + System.out.println("Самый быстрый автомобиль: " + winner.name); + + } + + scanner.close(); + } +} + +class Car { + String name; + double velocity; + + Car(String name, double velocity) { + this.name = name; + this.velocity = velocity; + } +} + +class Race { + static Car winner(Car[] cars) { + Car winner = null; + + for (Car c : cars) { + if (c.velocity >= 0 && c.velocity <= 250) { + if (winner == null || c.velocity * 24 > winner.velocity * 24) { + winner = c; + } + } + } + return winner; + } +} From 644e7815b2d7c9822183528eed7cdbf22130c927 Mon Sep 17 00:00:00 2001 From: IFeelLikeGod <148801740+IFeelLikeGod@users.noreply.github.com> Date: Tue, 6 Jan 2026 12:46:22 +0300 Subject: [PATCH 3/4] Delete VelocityOfCars.java --- VelocityOfCars.java | 64 --------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 VelocityOfCars.java diff --git a/VelocityOfCars.java b/VelocityOfCars.java deleted file mode 100644 index 76c7ce5a..00000000 --- a/VelocityOfCars.java +++ /dev/null @@ -1,64 +0,0 @@ -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - int n = 3; - - - Car[] cars = new Car[n]; - - for (int i = 0; i < n; i++) { - System.out.println("Введите название машины №" + (i + 1) + ":"); - String name = scanner.nextLine(); - - double velocity; - while (true) { - System.out.println("— Введите скорость машины №" + (i + 1) + ":"); - velocity = scanner.nextDouble(); - scanner.nextLine(); - - if (velocity >= 0 && velocity <= 250) break; - System.out.println("Неправильная скорость"); - } - - cars[i] = new Car(name, velocity); - } - - Car winner = Race.winner(cars); - - if (winner == null) { - System.out.println("Нет машин с допустимой скоростью. Допустимая скорость от 0 до 250"); - } else { - System.out.println("Самый быстрый автомобиль: " + winner.name); - - } - - scanner.close(); - } -} - -class Car { - String name; - double velocity; - - Car(String name, double velocity) { - this.name = name; - this.velocity = velocity; - } -} - -class Race { - static Car winner(Car[] cars) { - Car winner = null; - - for (Car c : cars) { - if (c.velocity >= 0 && c.velocity <= 250) { - if (winner == null || c.velocity * 24 > winner.velocity * 24) { - winner = c; - } - } - } - return winner; - } -} From f2e4abfa9c4e77b81336bb33277e29f14a63156a Mon Sep 17 00:00:00 2001 From: IFeelLikeGod <148801740+IFeelLikeGod@users.noreply.github.com> Date: Tue, 6 Jan 2026 12:48:20 +0300 Subject: [PATCH 4/4] Delete projectNumberOne.java --- projectNumberOne.java | 64 ------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 projectNumberOne.java diff --git a/projectNumberOne.java b/projectNumberOne.java deleted file mode 100644 index 76c7ce5a..00000000 --- a/projectNumberOne.java +++ /dev/null @@ -1,64 +0,0 @@ -import java.util.Scanner; - -public class Main { - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - int n = 3; - - - Car[] cars = new Car[n]; - - for (int i = 0; i < n; i++) { - System.out.println("Введите название машины №" + (i + 1) + ":"); - String name = scanner.nextLine(); - - double velocity; - while (true) { - System.out.println("— Введите скорость машины №" + (i + 1) + ":"); - velocity = scanner.nextDouble(); - scanner.nextLine(); - - if (velocity >= 0 && velocity <= 250) break; - System.out.println("Неправильная скорость"); - } - - cars[i] = new Car(name, velocity); - } - - Car winner = Race.winner(cars); - - if (winner == null) { - System.out.println("Нет машин с допустимой скоростью. Допустимая скорость от 0 до 250"); - } else { - System.out.println("Самый быстрый автомобиль: " + winner.name); - - } - - scanner.close(); - } -} - -class Car { - String name; - double velocity; - - Car(String name, double velocity) { - this.name = name; - this.velocity = velocity; - } -} - -class Race { - static Car winner(Car[] cars) { - Car winner = null; - - for (Car c : cars) { - if (c.velocity >= 0 && c.velocity <= 250) { - if (winner == null || c.velocity * 24 > winner.velocity * 24) { - winner = c; - } - } - } - return winner; - } -}