Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions src/main/java/Main.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
/**
* Created by iyasuwatts on 10/17/17.
*/

import java.util.Scanner;

public class Main {

public static void main(String[] args){

// my first comment
public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

System.out.println("Guess a number between 1 and 10");
long answer = scan.nextInt();
long randomNumber = Math.round(Math.random() * 10);
System.out.println(randomNumber);

if (answer == randomNumber) {
System.out.println("Correct!");

} else if (answer < randomNumber) {
System.out.println("This is too small");

} else if (answer > randomNumber) {
System.out.println("This is too large");
}
}
}

}