how to use a a scanner to Ask the user to guess the number until = to random number : so heres my code
public class JavaAsig8 {

    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int number;
        
        System.out.print("Enter a whole number: ");
        number = stdIn.nextInt();
        Random r = new Random();
        for (int i = 0; i < number; i++) {
            Random rn = new Random();
            int answer = rn.nextInt(10) + 1;
            System.out.println(answer);

        }

    }

} 
but i need to be able to Ask the user to guess the number until = to random number 
