import java.util.*;
public class Testing {
public static void main(String[] args) {
Random rand = new Random();
int random = (int)(Math.random() * 3 + 1);
//to see what number to guess
System.out.println(random);
int score = 0;
Scanner input = new Scanner(System.in);
System.out.print("Enter Number: ");
String num = input.nextLine();
int count = 0;
while (count <= 5) {
if (random == 1) {
if (num.equals("one")) {
System.out.println("correct");
score++;
}
else {
System.out.print("Wrong!");
}
}
else if (random == 2) {
if (num.equals("two")) {
System.out.println("correct");
score++;
}
else {
System.out.print("Wrong!");
}
}
else {
if (num.equals("three")) {
System.out.println("correct");
score++;
}
else {
System.out.print("Wrong!");
}
}
count++;
}
System.out.println(score);
}
}
How do I make it that will ask 5 different random numbers ?.
After every good guess, the score should be incremented by 1.
After every guess (good or bad), it should proceed to another random number?