Assignemnt #58 One Shot Hi-Lo
Code
///Name: Prooz Fereydouni
///Period: 7
///Project Name: One Shot Hi-Lo
///File Name: OSHL.java
///Date: 11/16/2015
import java.util.Scanner;
import java.util.Random;
public class OSHL
{
public static void main ( String[] args )
{
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int number, guess;
number = 1 + r.nextInt(100);
System.out.println("I'm thinking of a number between 1-100. Try to guess it.");
guess = keyboard.nextInt();
System.out.println("");
if(guessnumber)
System.out.println("Sorry, you are too high. I was thinking of " + number + ".");
if(guess==number)
System.out.println("You guessed it! What are the odds?!?");
}
}
Picture of the output