Assignment #61 and Keep Guessing
Code
///Name: Mark Katz
///Period: 6
///Program Name: Keep Guessing
///File Name: keepgoing.java
///Date Finished: 10/21/15
import java.util.Random;
import java.util.Scanner;
public class keepgoing
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int guess, n;
n = 1+r.nextInt(10);
System.out.println("LE WURST GAM EVR");
System.out.println("");
System.out.print("iM TINKIN' UF A NUMBA BTWEN 1-10. GES ITT. ");
guess = keyboard.nextInt();
System.out.println("");
while (guess != n)
{
System.out.println("That is incorrect. Guess again");
System.out.print(">");
n = keyboard.nextInt();
}
System.out.println("Nice Job! You got it right!!!" );
}
}
Picture of the output