-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* docs: adding subject * docs: fixing format * docs: fix minor typos --------- Co-authored-by: amine <[email protected]>
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
$ | ||
``` |