Lottery with JAVA

import java.util.Random;
import java.util.Scanner;

public class nameSurnameLottery {

static Scanner reader = new Scanner(System.in);

public static void main(String[] args) {

print(“Please enter the column numbers: “, true);
int colNum = reader.nextInt();

int[][] userNumbers = new int[colNum][6];
int[] luckyNumbers = new int[6];

for (int i = 0; i < colNum; i++) {
print(“Please enter the numbers for column ” + (i + 1) + “:”, true);
for (int j = 0; j < 6; j++) {

userNumbers[i][j] = reader.nextInt();

while (userNumbers[i][j] < 1 || userNumbers[i][j] > 49) {
print(“Please! enter number between 1 and 49, enter again:”,
true);
userNumbers[i][j] = reader.nextInt();
}
}
}

print(“Lucky numbers: “, false);
for (int i = 0; i < 6; i++) {
luckyNumbers[i] = randInt(1, 49);
print(” ” + String.valueOf(luckyNumbers[i]), false);
}

for (int i = 0; i < colNum; i++) { int matched = checkNumbers(luckyNumbers, userNumbers[i]); String price = “”; if (matched >= 3)
price += “you won “;

switch (matched) {
case 6:
price += “1500000$”;
break;
case 5:
price += “500$”;
break;
case 4:
price += “15$”;
break;
case 3:
price += “5$”;
break;
default:
price = “LOOOSER”;
break;
}

print(“\nFor column ” + (i + 1) + ” ” + price, true);
}

}

private static void print(String txt, Boolean nl) {
if (nl) {
System.out.println(txt);
} else {
System.out.print(txt);
}

}

public static int randInt(int min, int max) {
Random rand = new Random();
int randomNum = rand.nextInt((max – min) + 1) + min;
return randomNum;
}

public static int checkNumbers(int[] luckynumber, int[] userArray) {
int matched = 0;

for (int i = 0; i < userArray.length; i++) {
for (int j = 0; j < luckynumber.length; j++) {
if (userArray[i] == luckynumber[j]) {
matched++;
break;
}
}
}
return matched;
}

}