Our 3rd grade daughter is learning multiplication and division 1 to 12.  I wrote this code to print sheets for her to practice with.

public class Main {
public static void main(String[] args) {
MultipleArray.multipleArray();
}
}
import java.util.Random;




public class MultipleArray {

public static void multipleArray() {
System.out.println();
System.out.println();

int[][] arr = new int[13][13];
arr[0][0] = 0;

for (int x = 1; x < 13; x++) {

// label top row 1 to 12
arr[0][x] = x;

// label first column 1 to 12
arr[x][0] = x;
}

for (int x = 1; x < 13; x++) {
for (int y = 1; y < 13; y++) {
arr[x][y] = x * y;
}
}

Random rand = new Random();

// Multiplication
for (int x = 1; x < 11; x++) {
for (int y = 1; y < 6; y++) {
int rand_x = rand.nextInt(11) + 1;
int rand_y = rand.nextInt(11) + 1;
System.out.printf(arr[rand_x][0] + " * " + "___" + " = " + arr[rand_x][rand_y] + " ");
}
System.out.println();
System.out.println();

}

for ( int x = 1; x < 10; x++) {
System.out.println();
}

// Division sign
char ch = 247;
String hex = String.format("%04x", (int) ch);
// System.out.println(hex);
int hexToInt = Integer.parseInt(hex, 16);
char intToChar = (char)hexToInt;

//Division
for (int x = 1; x < 11; x++) {
for (int y = 1; y < 6; y++) {
int rand_x = rand.nextInt(11) + 1;
int rand_y = rand.nextInt(11) + 1;
System.out.printf( arr[rand_x][rand_y] + " " + intToChar + " " + "___" + " = " + arr[rand_x][0] + " ");

}
System.out.println();
System.out.println();
}

}
}
C:\Users\Win10x64i7\.jdks\openjdk-23.0.1\bin\java.exe "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2024.2.4\lib\idea_rt.jar=51247:D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2024.2.4\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath C:\Users\Win10x64i7\IdeaProjects\Ann\out\production\Ann Main


8 * ___ = 32 2 * ___ = 20 10 * ___ = 100 4 * ___ = 20 11 * ___ = 99

2 * ___ = 6 7 * ___ = 56 5 * ___ = 15 8 * ___ = 64 5 * ___ = 40

8 * ___ = 24 7 * ___ = 14 11 * ___ = 55 7 * ___ = 49 7 * ___ = 49

2 * ___ = 4 7 * ___ = 56 10 * ___ = 60 5 * ___ = 40 4 * ___ = 44

9 * ___ = 9 1 * ___ = 11 6 * ___ = 66 7 * ___ = 56 7 * ___ = 28

10 * ___ = 80 11 * ___ = 77 8 * ___ = 16 11 * ___ = 121 9 * ___ = 81

4 * ___ = 20 11 * ___ = 77 8 * ___ = 40 8 * ___ = 16 9 * ___ = 27

7 * ___ = 77 7 * ___ = 63 9 * ___ = 72 6 * ___ = 30 2 * ___ = 10

3 * ___ = 6 11 * ___ = 99 2 * ___ = 2 11 * ___ = 121 11 * ___ = 99

7 * ___ = 56 10 * ___ = 10 8 * ___ = 48 5 * ___ = 10 6 * ___ = 24














4 ÷ ___ = 1 12 ÷ ___ = 4 88 ÷ ___ = 11 9 ÷ ___ = 9 14 ÷ ___ = 7

6 ÷ ___ = 1 20 ÷ ___ = 4 28 ÷ ___ = 7 10 ÷ ___ = 5 54 ÷ ___ = 6

22 ÷ ___ = 11 42 ÷ ___ = 6 55 ÷ ___ = 5 28 ÷ ___ = 4 35 ÷ ___ = 7

10 ÷ ___ = 1 18 ÷ ___ = 6 90 ÷ ___ = 9 15 ÷ ___ = 5 66 ÷ ___ = 6

81 ÷ ___ = 9 45 ÷ ___ = 5 77 ÷ ___ = 7 77 ÷ ___ = 11 42 ÷ ___ = 7

14 ÷ ___ = 2 32 ÷ ___ = 8 10 ÷ ___ = 1 24 ÷ ___ = 8 54 ÷ ___ = 6

33 ÷ ___ = 3 11 ÷ ___ = 1 64 ÷ ___ = 8 8 ÷ ___ = 4 12 ÷ ___ = 4

24 ÷ ___ = 3 27 ÷ ___ = 3 22 ÷ ___ = 2 22 ÷ ___ = 11 3 ÷ ___ = 1

28 ÷ ___ = 4 77 ÷ ___ = 11 16 ÷ ___ = 4 5 ÷ ___ = 5 24 ÷ ___ = 6

18 ÷ ___ = 3 40 ÷ ___ = 10 63 ÷ ___ = 7 24 ÷ ___ = 4 63 ÷ ___ = 9


Process finished with exit code 0