Assignment #55 and Number Guessing Game
Code
///Name: Mark Katz
///Period: 6
///Program Name: A Number-Guessing Game
///File Name: randomnumbergame.java
///Date Finished: 10/21/15
import java.util.Random;
import java.util.Scanner;
public class randomnumbergame
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int choice = 1 + r.nextInt(10), s;
String response = "";
System.out.println("LE WURST GAM EVR");
System.out.println("");
System.out.print("iM TINKIN' UF A NUMBA BTWEN 1-10. GES ITT. ");
s = keyboard.nextInt();
System.out.println("");
if (choice == s)
{
System.out.println("GUD JOBB!");
}
else
{
System.out.println("U SUK! MY NUMBA WAZ " + choice );
}
}
}
Picture of the output