Compare commits

...

5 Commits

Author SHA1 Message Date
zanninso 8a952b797c
CON-2553-Markdown-Sort-Array-exercise (#2526) 2 weeks ago
zanninso 8e53a43c56
CON-2549-Markdown-Digitlen-exercise (#2525) 2 weeks ago
zanninso 50c790876e
CON-2541-Markdown-Strlen-exercise (#2523) 2 weeks ago
zanninso ad35c24f25
CON-2537-Markdown-Average-Calc-exercise (#2522) 2 weeks ago
zanninso 421897ecff
CON-2533-Markdown-Multiplication-Table-exercise (#2521) 2 weeks ago
  1. 36
      subjects/java/checkpoints/average-calc/README.md
  2. 36
      subjects/java/checkpoints/digitlen/README.md
  3. 45
      subjects/java/checkpoints/multiplication-table/README.md
  4. 39
      subjects/java/checkpoints/sort-array/README.md
  5. 36
      subjects/java/checkpoints/strlen/README.md

36
subjects/java/checkpoints/average-calc/README.md

@ -0,0 +1,36 @@
## AverageCalc
### Instructions
Write a function named `average` in a file named `AverageCalc` java. This function takes three parameters: start, end, and step. It returns the average of the numbers between start and end with each number being greater than the previous one by the step given.
### Expected Functions
```java
public class AverageCalc {
public static int average(int start, int end, int step) {
// your code here
}
}
```
### Usage
Here is a possible `ExerciseRunner.java` to test your function :
```java
public class ExerciseRunner {
public static void main(String[] args) {
System.out.println(AverageCalc.average(1,5,1));
}
}
```
and its output :
```shell
$ javac *.java -d build
$ java -cp build ExerciseRunner
3
$
```

36
subjects/java/checkpoints/digitlen/README.md

@ -0,0 +1,36 @@
## Digitlen
### Instructions
In a file named `Digitlen.java` write a function `digitlen` that returns the count of digits in the number passed as a parameter.
### Expected Functions
```java
public class Digitlen {
public static int digitlen(long number) {
// your code here
}
}
```
### Usage
Here is a possible `ExerciseRunner.java` to test your function :
```java
public class ExerciseRunner {
public static void main(String[] args) {
System.out.println(Digitlen.digitlen(9989898878));
}
}
```
and its output :
```shell
$ javac *.java -d build
$ java -cp build ExerciseRunner
10
$
```

45
subjects/java/checkpoints/multiplication-table/README.md

@ -0,0 +1,45 @@
## MultiplicationTable
### Instructions
In a file named `MultiplicationTable.java` write a function `generate` which takes a number as a parameter, and prints the multiplication table for this number.
### Expected Functions
```java
public class MultiplicationTable {
public static void generate(int num) {
// your code here
}
}
```
### Usage
Here is a possible `ExerciseRunner.java` to test your function :
```java
public class ExerciseRunner {
public static void main(String[] args) {
MultiplicationTable.generate(5);
}
}
```
and its output :
```shell
$ javac *.java -d build
$ java -cp build ExerciseRunner
5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50
$
```

39
subjects/java/checkpoints/sort-array/README.md

@ -0,0 +1,39 @@
## SortArray
### Instructions
In a file named `SortArray.java` write a function `sort` that returns the given array, specified in the parameters, sorted in ascending order.
### Expected Functions
```java
public class SortArray {
public static Integer[] sort(Integer[] args) {
// your code here
}
}
```
### Usage
Here is a possible `ExerciseRunner.java` to test your function :
```java
import java.io.*;
import java.util.Arrays;
public class ExerciseRunner {
public static void main(String[] args) throws IOException {
System.out.println(Arrays.toString(SortArray.sort(new Integer[]{4, 2, 1, 3})));
}
}
```
and its output :
```shell
$ javac *.java -d build
$ java -cp build ExerciseRunner
[1, 2, 3, 4]
$
```

36
subjects/java/checkpoints/strlen/README.md

@ -0,0 +1,36 @@
## Strlen
### Instructions
In a file named `Strlen.java` write a function `strlen` that returns the length of the string passed as a parameter.
### Expected Functions
```java
public class Strlen {
public static int strlen(String s) {
// your code here
}
}
```
### Usage
Here is a possible `ExerciseRunner.java` to test your function :
```java
public class ExerciseRunner {
public static void main(String[] args) {
System.out.println(Strlen.strlen("Hello World !"));
}
}
```
and its output :
```shell
$ javac *.java -d build
$ java -cp build ExerciseRunner
13
$
```
Loading…
Cancel
Save