Skip to content

Commit f2720d8

Browse files
vaengiHiD
andauthored
Rename elon's toy car to jedlik's toy car (#2926)
--------- Co-authored-by: Jeremy Walker <[email protected]>
1 parent f193def commit f2720d8

File tree

17 files changed

+40
-40
lines changed

17 files changed

+40
-40
lines changed

config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@
110110
"status": "active"
111111
},
112112
{
113-
"slug": "elons-toy-car",
114-
"name": "Elon's Toy Car",
113+
"slug": "jedliks-toy-car",
114+
"name": "Jedlik's Toy Car",
115115
"uuid": "2ae791e9-eb7a-4344-841d-0c4797e5106c",
116116
"concepts": [
117117
"classes"
Binary file not shown.

exercises/concept/elons-toy-car/.docs/instructions.md renamed to exercises/concept/jedliks-toy-car/.docs/instructions.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,38 @@ You have six tasks, each of which will work with remote controlled car instances
1515

1616
## 1. Buy a brand-new remote controlled car
1717

18-
Implement the (_static_) `ElonsToyCar.buy()` method to return a brand-new remote controlled car instance:
18+
Implement the (_static_) `JedliksToyCar.buy()` method to return a brand-new remote controlled car instance:
1919

2020
```java
21-
ElonsToyCar car = ElonsToyCar.buy();
21+
JedliksToyCar car = JedliksToyCar.buy();
2222
```
2323

2424
## 2. Display the distance driven
2525

26-
Implement the `ElonsToyCar.distanceDisplay()` method to return the distance as displayed on the LED display:
26+
Implement the `JedliksToyCar.distanceDisplay()` method to return the distance as displayed on the LED display:
2727

2828
```java
29-
ElonsToyCar car = ElonsToyCar.buy();
29+
JedliksToyCar car = JedliksToyCar.buy();
3030
car.distanceDisplay();
3131
// => "Driven 0 meters"
3232
```
3333

3434
## 3. Display the battery percentage
3535

36-
Implement the `ElonsToyCar.batteryDisplay()` method to return the battery percentage as displayed on the LED display:
36+
Implement the `JedliksToyCar.batteryDisplay()` method to return the battery percentage as displayed on the LED display:
3737

3838
```java
39-
ElonsToyCar car = ElonsToyCar.buy();
39+
JedliksToyCar car = JedliksToyCar.buy();
4040
car.batteryDisplay();
4141
// => "Battery at 100%"
4242
```
4343

4444
## 4. Update the number of meters driven when driving
4545

46-
Implement the `ElonsToyCar.drive()` method that updates the number of meters driven:
46+
Implement the `JedliksToyCar.drive()` method that updates the number of meters driven:
4747

4848
```java
49-
ElonsToyCar car = ElonsToyCar.buy();
49+
JedliksToyCar car = JedliksToyCar.buy();
5050
car.drive();
5151
car.drive();
5252
car.distanceDisplay();
@@ -55,10 +55,10 @@ car.distanceDisplay();
5555

5656
## 5. Update the battery percentage when driving
5757

58-
Update the `ElonsToyCar.drive()` method to update the battery percentage:
58+
Update the `JedliksToyCar.drive()` method to update the battery percentage:
5959

6060
```java
61-
ElonsToyCar car = ElonsToyCar.buy();
61+
JedliksToyCar car = JedliksToyCar.buy();
6262
car.drive();
6363
car.drive();
6464
car.batteryDisplay();
@@ -67,10 +67,10 @@ car.batteryDisplay();
6767

6868
## 6. Prevent driving when the battery is drained
6969

70-
Update the `ElonsToyCar.drive()` method to not increase the distance driven nor decrease the battery percentage when the battery is drained (at 0%):
70+
Update the `JedliksToyCar.drive()` method to not increase the distance driven nor decrease the battery percentage when the battery is drained (at 0%):
7171

7272
```java
73-
ElonsToyCar car = ElonsToyCar.buy();
73+
JedliksToyCar car = JedliksToyCar.buy();
7474

7575
// Drain the battery
7676
// ...

exercises/concept/elons-toy-car/.meta/config.json renamed to exercises/concept/jedliks-toy-car/.meta/config.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
],
88
"files": {
99
"solution": [
10-
"src/main/java/ElonsToyCar.java"
10+
"src/main/java/JedliksToyCar.java"
1111
],
1212
"test": [
13-
"src/test/java/ElonsToyCarTest.java"
13+
"src/test/java/JedliksToyCarTest.java"
1414
],
1515
"exemplar": [
16-
".meta/src/reference/java/ElonsToyCar.java"
16+
".meta/src/reference/java/JedliksToyCar.java"
1717
],
1818
"invalidator": [
1919
"build.gradle"
2020
]
2121
},
22-
"icon": "elons-toys",
22+
"icon": "jedliks-toys",
2323
"blurb": "Learn about classes by working on a remote controlled car."
2424
}

exercises/concept/elons-toy-car/.meta/src/reference/java/ElonsToyCar.java renamed to exercises/concept/jedliks-toy-car/.meta/src/reference/java/JedliksToyCar.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class ElonsToyCar {
1+
class JedliksToyCar {
22
private int batteryPercentage = 100;
33
private int distanceDrivenInMeters = 0;
44

@@ -21,7 +21,7 @@ public String batteryDisplay() {
2121
return "Battery at " + batteryPercentage + "%";
2222
}
2323

24-
public static ElonsToyCar buy() {
25-
return new ElonsToyCar();
24+
public static JedliksToyCar buy() {
25+
return new JedliksToyCar();
2626
}
2727
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
public class ElonsToyCar {
2-
public static ElonsToyCar buy() {
3-
throw new UnsupportedOperationException("Please implement the (static) ElonsToyCar.buy() method");
1+
public class JedliksToyCar {
2+
public static JedliksToyCar buy() {
3+
throw new UnsupportedOperationException("Please implement the (static) JedliksToyCar.buy() method");
44
}
55

66
public String distanceDisplay() {
7-
throw new UnsupportedOperationException("Please implement the ElonsToyCar.distanceDisplay() method");
7+
throw new UnsupportedOperationException("Please implement the JedliksToyCar.distanceDisplay() method");
88
}
99

1010
public String batteryDisplay() {
11-
throw new UnsupportedOperationException("Please implement the ElonsToyCar.batteryDisplay() method");
11+
throw new UnsupportedOperationException("Please implement the JedliksToyCar.batteryDisplay() method");
1212
}
1313

1414
public void drive() {
15-
throw new UnsupportedOperationException("Please implement the ElonsToyCar.drive() method");
15+
throw new UnsupportedOperationException("Please implement the JedliksToyCar.drive() method");
1616
}
1717
}

exercises/concept/elons-toy-car/src/test/java/ElonsToyCarTest.java renamed to exercises/concept/jedliks-toy-car/src/test/java/JedliksToyCarTest.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,45 @@
44

55
import static org.assertj.core.api.Assertions.assertThat;
66

7-
public class ElonsToyCarTest {
7+
public class JedliksToyCarTest {
88
@Test
99
@Tag("task:1")
1010
@DisplayName("The static buy method returns a new remote controlled car instance")
1111
public void buy_new_car_returns_instance() {
12-
ElonsToyCar car = ElonsToyCar.buy();
12+
JedliksToyCar car = JedliksToyCar.buy();
1313
assertThat(car).isNotNull();
1414
}
1515

1616
@Test
1717
@Tag("task:1")
1818
@DisplayName("The static buy method returns each time a new remote controlled car instance")
1919
public void buy_new_car_returns_new_car_each_time() {
20-
ElonsToyCar car1 = ElonsToyCar.buy();
21-
ElonsToyCar car2 = ElonsToyCar.buy();
20+
JedliksToyCar car1 = JedliksToyCar.buy();
21+
JedliksToyCar car2 = JedliksToyCar.buy();
2222
assertThat(car1).isNotEqualTo(car2);
2323
}
2424

2525
@Test
2626
@Tag("task:2")
2727
@DisplayName("The distanceDisplay method shows 0 meters message on a new car")
2828
public void new_car_distance_display() {
29-
ElonsToyCar car = new ElonsToyCar();
29+
JedliksToyCar car = new JedliksToyCar();
3030
assertThat(car.distanceDisplay()).isEqualTo("Driven 0 meters");
3131
}
3232

3333
@Test
3434
@Tag("task:3")
3535
@DisplayName("The batteryDisplay method shows full battery message on a new car")
3636
public void new_car_battery_display() {
37-
ElonsToyCar car = new ElonsToyCar();
37+
JedliksToyCar car = new JedliksToyCar();
3838
assertThat(car.batteryDisplay()).isEqualTo("Battery at 100%");
3939
}
4040

4141
@Test
4242
@Tag("task:4")
4343
@DisplayName("The distanceDisplay method shows the correct message after driving once")
4444
public void distance_display_after_driving_once() {
45-
ElonsToyCar car = new ElonsToyCar();
45+
JedliksToyCar car = new JedliksToyCar();
4646
car.drive();
4747
assertThat(car.distanceDisplay()).isEqualTo("Driven 20 meters");
4848
}
@@ -51,7 +51,7 @@ public void distance_display_after_driving_once() {
5151
@Tag("task:4")
5252
@DisplayName("The distanceDisplay method shows the correct message after driving multiple times")
5353
public void distance_display_after_driving_multiple_times() {
54-
ElonsToyCar car = new ElonsToyCar();
54+
JedliksToyCar car = new JedliksToyCar();
5555

5656
for (int i = 0; i < 17; i++) {
5757
car.drive();
@@ -64,7 +64,7 @@ public void distance_display_after_driving_multiple_times() {
6464
@Tag("task:5")
6565
@DisplayName("The batteryDisplay method shows the correct message after driving once")
6666
public void battery_display_after_driving_once() {
67-
ElonsToyCar car = new ElonsToyCar();
67+
JedliksToyCar car = new JedliksToyCar();
6868
car.drive();
6969

7070
assertThat(car.batteryDisplay()).isEqualTo("Battery at 99%");
@@ -74,7 +74,7 @@ public void battery_display_after_driving_once() {
7474
@Tag("task:5")
7575
@DisplayName("The batteryDisplay method shows the correct battery percentage after driving multiple times")
7676
public void battery_display_after_driving_multiple_times() {
77-
ElonsToyCar car = new ElonsToyCar();
77+
JedliksToyCar car = new JedliksToyCar();
7878

7979
for (int i = 0; i < 23; i++) {
8080
car.drive();
@@ -87,7 +87,7 @@ public void battery_display_after_driving_multiple_times() {
8787
@Tag("task:5")
8888
@DisplayName("The batteryDisplay method shows battery empty after draining all battery")
8989
public void battery_display_when_battery_empty() {
90-
ElonsToyCar car = new ElonsToyCar();
90+
JedliksToyCar car = new JedliksToyCar();
9191

9292
// Drain the battery
9393
for (int i = 0; i < 100; i++) {
@@ -104,7 +104,7 @@ public void battery_display_when_battery_empty() {
104104
@Tag("task:6")
105105
@DisplayName("The distanceDisplay method shows the correct message after driving and draining all battery")
106106
public void distance_display_when_battery_empty() {
107-
ElonsToyCar car = new ElonsToyCar();
107+
JedliksToyCar car = new JedliksToyCar();
108108

109109
// Drain the battery
110110
for (int i = 0; i < 100; i++) {

exercises/settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include 'concept:booking-up-for-beauty'
88
include 'concept:calculator-conundrum'
99
include 'concept:captains-log'
1010
include 'concept:cars-assemble'
11-
include 'concept:elons-toy-car'
11+
include 'concept:jedliks-toy-car'
1212
include 'concept:football-match-reports'
1313
include 'concept:gotta-snatch-em-all'
1414
include 'concept:international-calling-connoisseur'

0 commit comments

Comments
 (0)