Assignemnt #58 One Shot hi-Lo
Code
//Tyler Hart
//period 5
//HiLo.java
//HiLo
//11/10/2015
import java.util.Random;
import java.util.Scanner;
public class HiLo
{
public static void main( String [] args)
{
Scanner key = new Scanner(System.in);
Random r = new Random();
int d1= r.nextInt(100)+1,d2;
System.out.println("Number 1-100?");
d2 = key.nextInt();
if (d1==d2)
{
System.out.println("Yep");
}
else if (d1 <= d2)
{
System.out.println("Too hight");
}
else
System.out.println("Too low");
}
}
Picture of the output