package assi2question1; import java.lang.*; import java.util.Scanner; public class Assi2question1 { public static void main(String[] args) { int random, userInput; userInput = -1; random = (int)(100.0 * Math.random()); System.out.println(random); Scanner keyboard = new Scanner(System.in); System.out.println("Guess an integer number between 0 and 100"); while (random != userInput) { userInput = keyboard.nextInt(); System.out.println(userInput + " is not the number I guessed. Guess again."); if (userInput < 0) { System.out.println(userInput + " is low. Please enter a number >= 0"); } if (userInput > 100) { System.out.println(userInput + " is high. Please enter a number <= 100"); } } System.out.println("Congratulations," + random + " is the number I picked."); } }