// Game.java (c) Kari Laitinen // http://www.naturalprogramming.com // 2003-10-02 File created. // 2023-01-06 The following comment was added. /* To compile and run Java programs, you need to get a Java SE Development Kit (JDK) from a company named Oracle. You should find it easily if you Google with the words: Download JDK Before downloading the installation file you need to select a suitable JDK for your operating system. In January 2023 the installation file could be downloaded without registration at Oracle. After I had run the installation file, I used the following commands in the Windows Command Prompt Window to compile and run this program that was located in folder E:\programs\javafiles2 E: cd programs cd javafiles2 "C:\Program Files\Java\jdk-19\bin\javac" Game.java "C:\Program Files\Java\jdk-19\bin\java" Game Compilation was done with command "javac" and execution with command "java". Those commands had to be preceded with "C:\Program Files\Java\jdk-19\bin\" because that folder did not belong to the Path of my computer. If you can find out how to include the JDK folder into the Path of your computer, you can compile and run the Java programs with the simple commands, and without quotation marks. To find out how to set the Path, Google with words: set path in windows If you work with macOS, the path is set automatically when you install the JDK, and you can use the short commands "javac" and "java". */ import java.util.* ; class Game { public static void main( String[] not_in_use ) { Scanner keyboard = new Scanner( System.in ) ; int integer_from_keyboard ; int one_larger_integer ; System.out.print( "\n This program is a computer game. Please, type in " + "\n an integer in the range 1 ... 2147483646 : " ) ; integer_from_keyboard = keyboard.nextInt() ; one_larger_integer = integer_from_keyboard + 1 ; System.out.print( "\n You typed in " + integer_from_keyboard + "." + "\n My number is " + one_larger_integer + "." + "\n Sorry, you lost. I won. The game is over.\n") ; } }