import java.util.Random;
import java.util.Scanner;
public class MultiplyTest {
static Random seed = new Random();
static Scanner scanner;
public static void main(String[] args) {
scanner = new Scanner(System.in);
multiply();
scanner.close();
}
private static void multiply() {
int response = 0;
while(response != -1) {
int x = 1 + seed.nextInt(10); // [ 1 <= x <= 10]
int y = 1 + seed.nextInt(10);
System.out.print("How much is " + x +
" times " + y + " ? : ");
try {
response = Integer.parseInt(scanner.nextLine());
} catch(NumberFormatException e) {
System.out.println("number format: " + e.getMessage());
}
while(response != -1 && response != x*y) {
System.out.print("No. Please try again: ");
try {
response = Integer.parseInt(scanner.nextLine());
} catch(NumberFormatException e) {
System.out.println("number format: " + e.getMessage());
}
}
if(response != -1)
System.out.println("Very Good");
}
}
}