The Worst Number-Guessing Game Ever
Code
/// Name: Mahima Choudhary
/// Period: 6
/// Program Name: The Worst Number-Guessing Game Ever
/// File Name: TheWorst.java
/// Date Finished: 11/30/2015
import java.util.Scanner;
public class TheWorst {
public static void main( String[] args ) {
Scanner keyboard = new Scanner(System.in);
int guess, number;
number = 2;
System.out.println( "Prepare yourself for the most epic game!" );
System.out.println();
System.out.print( "I'm thinking of a number from 1-10. I bet you can't get it: " );
guess = keyboard.nextInt();
System.out.println();
if ( guess == number ) {
System.out.println( "Woah today is your lucky day, go buy a lotto" );
}
if ( guess > number ) {
System.out.println( "HA NOOOOO. It was " + number + "!" );
}
if ( guess < number ) {
System.out.println( "HA NOOOOOO. It was " + number + "!" );
}
}
}
Picture of the output