repl.it
Java

No description

fork
loading
Files
  • Main.java
  • jdt.ls-java-project
Main.java
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
import java.util.Scanner;
 class Main {
   public static void main(String[] args) {
     
     Scanner input = new Scanner(System.in);
    
     do {
     
     Continue = true;
     int number = 20;
     int Count = 1;
     
     
     System.out.println("Enter a number between 1 and 100");
     int choice = Integer.parseInt(input.nextLine());
 
     if (choice == number){
       System.out.println("Correct");
      }
     
     else{
      System.out.println("Wrong - Try again");
     }
     
     Count = Count + 1;
     
     
     
     System.out.println("You took" + Count & "Attempts");
     } while (Continue = true);
     
     
   }
}