/**This program is a simple number guessing game
using the random class */
import java.util.Scanner;
import java.util.Random;
public class numGuessing {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
Random rndm = new Random();
int num = rndm.nextInt(50);
int numGuess;
System.out.println("Please try to guess a number 1 to 50 !");
numGuess = input.nextInt();
while (numGuess != rndm) {
if (numGuess < rndm) {
System.out.println("Too low. Try again !");
numGuess = input.nextInt(); }
if (numGuess > rndm) {
System.out.println("Too high. Tr again !");
numGuess = inut.nextInt(); }
if (numGuess == rndm) {
System.out.println("Great job. You guessed the correct number."); }}
}}
}
This code is suppose to find the random number the computer chooses, but it's giving me a (Incompatible operand types int and Random) error. how do i fix it? Thnx