Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Guessing
- {
- public static void main(String args[]) throws java.io.IOException
- {
- System.out.println("Welcome to the Guessing Game!\n\nA if this is your first time.\nB if you are just a bit into the season.\nC if you think you have what its got.\nQ if you cannot take it.");
- Scanner scan = new Scanner(System.in);
- char choice = scan.next().charAt(0);
- if(choice == 'A' || choice == 'a')
- {
- System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- System.out.println("You have chosen the way of the weak. You have no limit in choices.");
- {
- int ans;
- { ans = (int)(Math.random() * 10 + 1);
- do{
- int resp = scan.nextInt();
- {
- if(resp == ans)
- {
- System.out.println("Good job!");
- }
- if(resp > ans)
- {
- System.out.println("A little to big");
- }
- if (resp < ans)
- {
- System.out.println("A little to small");
- }
- }while(resp != ans);
- }
- }
- }
- if else(choice == 'Q' || choice == 'q')
- {
- System.exit(0);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement