import java.lang.Math;
import java.util.Scanner;

public class NumberGuess {
    private int answer;
    private int guess;
    Scanner in = new Scanner(System.in);
    public NumberGuess() {
        this.answer = (int) Math.floor(Math.random()*10 + 1);
        System.out.println(answer);
    }
    public void play() {
        while (answer != guess) {
            this.getGuess();
        }
        in.close();
    }
    public void getGuess() {
        System.out.print("Guess a number 1-10: ");
        this.guess = in.nextInt();
        System.out.println(this.guess);
        if (this.guess > this.answer) {
            System.out.println("too high");
        } else if (this.guess < this.answer) {
            System.out.println("too low");
        } else {
            System.out.println("congrats");
        }
    }
    public static void main(String[] args) {
        NumberGuess num = new NumberGuess();
        num.play();
    }
}

Second Quiz

Casting, specifically for Division Casting, specifically for Truncating or Rounding Wrapper Classes, why wrap int, double. Show examples Concatenation, explain or illustrate rules on mixed type Concatenation Math class, specifically Random usage Compound Boolean Expression