From 3a2bbda75d2c45ed8e302f26e47929013f1f7d42 Mon Sep 17 00:00:00 2001 From: manumafe98 Date: Tue, 27 Feb 2024 18:51:43 -0300 Subject: [PATCH 1/2] Fixing inconsistencies in the instructions and hints for the need-for-speed exercise --- exercises/concept/need-for-speed/.docs/hints.md | 3 +-- exercises/concept/need-for-speed/.docs/instructions.md | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/concept/need-for-speed/.docs/hints.md b/exercises/concept/need-for-speed/.docs/hints.md index 7228502c4..06cf45d67 100644 --- a/exercises/concept/need-for-speed/.docs/hints.md +++ b/exercises/concept/need-for-speed/.docs/hints.md @@ -28,11 +28,10 @@ ## 6. Check if a remote control car can finish a race -- Solving this is probably best done by [repeatedly driving the car][while]. +- Try applying a formula that compares the distance and speed against the battery and battery drain. - Remember that the car has a method to retrieve the distance it has driven. - Consider what to do when the battery has been drained before reaching the finish line. [constructor-syntax]: https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html [instance-constructors]: https://docs.oracle.com/javase/tutorial/java/javaOO/objectcreation.html -[while]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html [fields]: https://docs.oracle.com/javase/tutorial/java/javaOO/variables.html diff --git a/exercises/concept/need-for-speed/.docs/instructions.md b/exercises/concept/need-for-speed/.docs/instructions.md index 1f64100f0..b0fa31eaa 100644 --- a/exercises/concept/need-for-speed/.docs/instructions.md +++ b/exercises/concept/need-for-speed/.docs/instructions.md @@ -70,7 +70,7 @@ car.distanceDriven(); ## 6. Check if a remote control car can finish a race -To finish a race, a car has to be able to drive the race's distance. This means not draining its battery before having crossed the finish line. Implement the `RaceTrack.tryFinishTrack()` method that takes a `NeedForSpeed` instance as its parameter and returns `true` if the car can finish the race; otherwise, return `false`. To see if the car can finish the race, you should try to drive the car until either you reach the end of the track or the battery drains: +To finish a race, a car has to be able to drive the race's distance. This means not draining its battery before having crossed the finish line. Implement the `RaceTrack.tryFinishTrack()` method that takes a `NeedForSpeed` instance as its parameter and returns `true` if the car can finish the race; otherwise, return `false`: ```java int speed = 5; @@ -88,3 +88,4 @@ race.tryFinishTrack(car); car.distanceDriven() // => 100 +``` From 9ab152e507bcca5eb95ea03fab1aad93a3a1d1f3 Mon Sep 17 00:00:00 2001 From: manumafe98 Date: Tue, 27 Feb 2024 21:15:44 -0300 Subject: [PATCH 2/2] Removing redundant hint --- exercises/concept/need-for-speed/.docs/hints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/exercises/concept/need-for-speed/.docs/hints.md b/exercises/concept/need-for-speed/.docs/hints.md index 06cf45d67..ea0d20c3d 100644 --- a/exercises/concept/need-for-speed/.docs/hints.md +++ b/exercises/concept/need-for-speed/.docs/hints.md @@ -30,7 +30,6 @@ - Try applying a formula that compares the distance and speed against the battery and battery drain. - Remember that the car has a method to retrieve the distance it has driven. -- Consider what to do when the battery has been drained before reaching the finish line. [constructor-syntax]: https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html [instance-constructors]: https://docs.oracle.com/javase/tutorial/java/javaOO/objectcreation.html