Assignment #52
Code
/// Gian Adoremos
/// Period: 7
/// Program Name: FiftySecond Program
/// File Name: NumberGuessing.java
/// Date Finished: 11/19/2015
import java.util.Scanner;
public class NumberGuessing
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int secretNumber = 5;
int guess;
System.out.println("GUESS A NUMBER, ANY NUMBER!");
System.out.println();
System.out.println("Try to guess a number between 1 and 10. C'mon guess! ");
guess = keyboard.nextInt();
System.out.println();
if (guess == secretNumber)
System.out.println("OMGWTF you got it rite. It was " + secretNumber + "!");
else
System.out.println("HAHA WRONG it was " + secretNumber + "!");
}
}
Picture of the output