Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- int correct = 7;
- Scanner keyboard = new Scanner(System.in);
- System.out.println("I have chosen a number between 1 and 10. Try to guess it");
- System.out.println("Your guess: ");
- int entry = keyboard.nextInt();
- while (entry != 7){
- System.out.println("That is incorrect. Guess again.");
- System.out.println("Your guess: ");
- entry = keyboard.nextInt();
- }
- System.out.println("That's right. Your'e a good guesser");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement