Skip to content

Commit 1212138

Browse files
author
Julien Letrouit
committed
Arrays Koan french translation
1 parent 0f67326 commit 1212138

7 files changed

Lines changed: 162 additions & 156 deletions

File tree

src/main/java/bonuses/english/AboutArrays.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ public class AboutArrays {
8787
* Sometime, we would like to store a lot of values of the same type. Example: recording the battery level of a robot for every second during a 2m30s match (150 double values).
8888
* Having 150 variable of type 'double' would be very cumbersome to manipulate in our program. Instead, we would like a single variable, of a type storing all 150 values at once.
8989
*
90-
* Such a type is called an 'array'. To create an array of type and n values, you can write:
90+
* Such a type is called an 'array'. To create an array of values of type 'SomeType' with n values, you can write:
9191
*
92-
* SomeType[] someName = new SomeType[size];
92+
* SomeType[] myArray = new SomeType[n];
9393
*
9494
* Ex:
9595
*
@@ -125,7 +125,7 @@ public class AboutArrays {
125125
/**
126126
* # Last element of an array
127127
*
128-
* Write a method named 'first' with an array of integers 'array' as a parameter, which returns the last element of that array.
128+
* Write a method named 'last' with an array of integers 'array' as a parameter, which returns the last element of that array.
129129
*
130130
* --------- TIPS --------------
131131
*
@@ -209,7 +209,7 @@ public class AboutArrays {
209209
*
210210
* Write a method named 'min' with an array of integers 'array' as a parameter.
211211
* It returns the smallest number within the array.
212-
* If the array is empty, it should return -1.
212+
* If the array is empty, it should return Integer.MAX_VALUE, which is the largest possible int.
213213
*
214214
* -------------------------------
215215
*
@@ -235,7 +235,7 @@ public class AboutArrays {
235235
*
236236
* Using a 'for :' loop, write a method named 'min2' with an array of integers 'array' as a parameter.
237237
* It returns the smallest number within the array.
238-
* If the array is empty, it should return -1.
238+
* If the array is empty, it should return Integer.MAX_VALUE, which is the largest possible int.
239239
*
240240
* --------- TIPS --------------
241241
*
@@ -358,7 +358,7 @@ public class AboutArrays {
358358
/**
359359
* # Switch two elements
360360
*
361-
* Write a method named 'switch' with takes an array 'array' as a parameter.
361+
* Write a method named 'switchFirst2' with takes an array 'array' as a parameter.
362362
* If the array has 2 and only 2 elements, the method is switching them within the array.
363363
* Otherwise, it does nothing.
364364
*
@@ -371,7 +371,7 @@ public class AboutArrays {
371371
* var a = new int[2];
372372
* a[0] = 10;
373373
* a[1] = 3;
374-
* switch(a);
374+
* switchFirst2(a);
375375
*
376376
* a should be [3, 10].
377377
*
@@ -394,9 +394,8 @@ public class AboutArrays {
394394
* a[0] = 10;
395395
* a[1] = 3;
396396
* a[2] = 20;
397-
* reverse(a);
398397
*
399-
* Should return the array [20, 3, 10].
398+
* reverse(a) should return the array [20, 3, 10].
400399
*
401400
*/
402401

0 commit comments

Comments
 (0)