-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathMain.java
More file actions
41 lines (25 loc) · 849 Bytes
/
Main.java
File metadata and controls
41 lines (25 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import java.util.Random;
import java.util.Scanner;
/**
* Created by iyasuwatts on 10/17/17.
*/
public class Main {
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
Random rng = new Random();
int numberToGuess = rng.nextInt(100);
int numberOfTries =0;
System.out.println(numberOfTries);
System.out.print("pick a number 1-5");
Integer pickAnumber = stdin.nextInt();
Integer answer = 3;
int guessPick = 0;
if (pickAnumber == answer) {
System.out.print("Correct guess");
} else if (pickAnumber > answer) {
System.out.print("Too large");
} else if (pickAnumber < answer) {
System.out.println("Too small");
}
}
}