-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx03_GuessTheNumber.java
More file actions
43 lines (42 loc) · 1.08 KB
/
Copy pathEx03_GuessTheNumber.java
File metadata and controls
43 lines (42 loc) · 1.08 KB
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
41
42
43
package com.company;
import java.util.Random;
import java.util.Scanner;
//class game{
// public int number;
// public int guessNumber;
// public int how;
//
// void rand(){
// Random rand = new Random();
// this.number = rand.nextInt(100);
// }
// void userinput (){
// System.out.println("Enter any value");
// Scanner sc = new Scanner(System.in);
// this.guessNumber = sc.nextInt();
// }
// boolean isCorrectNumber(){
// if (number==guessNumber){
// System.out.println("Yes you are correct");
// return true;
// }
// else if (guessNumber<number) {
// System.out.println("Too low....");
// }
// else {
// System.out.println("Too high...");
// }
// return false;
// }
// }
//class GuessTheNumber_Exercise03{
// public static void main(String[] args) {
// game g = new game();
// boolean b = false;
// g.rand();
// while (!b) {
// g.userinput();
// b = g.isCorrectNumber();
// }
// }
//}