Skip to content

Commit 6e697e4

Browse files
authored
Fixing need-for-speed inconsistencies in the documentation/hints (#2738)
* Fixing inconsistencies in the instructions and hints for the need-for-speed exercise * Removing redundant hint
1 parent 63fa3ba commit 6e697e4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

exercises/concept/need-for-speed/.docs/hints.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@
2828

2929
## 6. Check if a remote control car can finish a race
3030

31-
- Solving this is probably best done by [repeatedly driving the car][while].
31+
- Try applying a formula that compares the distance and speed against the battery and battery drain.
3232
- Remember that the car has a method to retrieve the distance it has driven.
33-
- Consider what to do when the battery has been drained before reaching the finish line.
3433

3534
[constructor-syntax]: https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html
3635
[instance-constructors]: https://docs.oracle.com/javase/tutorial/java/javaOO/objectcreation.html
37-
[while]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html
3836
[fields]: https://docs.oracle.com/javase/tutorial/java/javaOO/variables.html

exercises/concept/need-for-speed/.docs/instructions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ car.distanceDriven();
7070

7171
## 6. Check if a remote control car can finish a race
7272

73-
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:
73+
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`:
7474

7575
```java
7676
int speed = 5;
@@ -88,3 +88,4 @@ race.tryFinishTrack(car);
8888

8989
car.distanceDriven()
9090
// => 100
91+
```

0 commit comments

Comments
 (0)