Assignemnt #61 and Keep Guessing
Code
///Name: Luke Shin
///Period: 7
///Project Name: guessin
///File Name: guessin.java
///Date: 12/10/2015
import java.util.Scanner;
import java.util.Random;
public class guessin{
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int a, num = 1 + r.nextInt(10);
System.out.print("GUESS 0-10: ");
a = keyboard.nextInt();
while ( a != num ){
System.out.println("Guess again: ");
a = keyboard.nextInt();
}
System.out.println("Yes");
Picture of the output