Advertisement
MelindaElezovic

Magic8Ball

Jan 6th, 2016
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1. //melinda
  2. //1.5.16
  3. //magic8ball
  4. import java.util.*;
  5. public class Magic8Ball
  6. {
  7.   public static void main(String[] args)
  8.   {
  9.    Scanner input = new Scanner(System.in);
  10.    int ans = (int)(Math.random()*16+1);
  11.    
  12.    System.out.println("WELCOME TO THE MAGIC 8 BALL");
  13.    System.out.print("Enter your question: ");
  14.    String response = input.nextLine();
  15.    
  16.    if (ans==1)
  17.      System.out.println("Outlook not so good");
  18.    else if (ans ==2)
  19.      System.out.println("Don't count in it");
  20.    else if(ans==3)
  21.      System.out.println("My sources say no");
  22.    else if(ans==4)
  23.      System.out.println("Without a doubt");
  24.    else if (ans==5)
  25.      System.out.println("Reply hazy, try again");
  26.    else if (ans==6)
  27.      System.out.println("It is certain");
  28.    else if(ans==7)
  29.      System.out.println("My reply is no");
  30.    else if(ans==8)
  31.      System.out.println("As i see it yes");
  32.    else if(ans==9)
  33.      System.out.println("Most likely");
  34.    else if(ans==10)
  35.      System.out.println("You may rely on it");
  36.    else if(ans==11)
  37.      System.out.println("Cannot predic now");
  38.    else if(ans==12)
  39.      System.out.println("Beter not tell you now");
  40.    else if(ans==13)
  41.      System.out.println("Very doubtful");
  42.    else if(ans==14)
  43.      System.out.println("Outlook good");
  44.    else if (ans==15)
  45.      System.out.println("Yes definetly");
  46.    else if(ans==16)
  47.      System.out.println("Concentrate and ask again");
  48.   }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement