Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //melinda
- //1.5.16
- //magic8ball
- import java.util.*;
- public class Magic8Ball
- {
- public static void main(String[] args)
- {
- Scanner input = new Scanner(System.in);
- int ans = (int)(Math.random()*16+1);
- System.out.println("WELCOME TO THE MAGIC 8 BALL");
- System.out.print("Enter your question: ");
- String response = input.nextLine();
- if (ans==1)
- System.out.println("Outlook not so good");
- else if (ans ==2)
- System.out.println("Don't count in it");
- else if(ans==3)
- System.out.println("My sources say no");
- else if(ans==4)
- System.out.println("Without a doubt");
- else if (ans==5)
- System.out.println("Reply hazy, try again");
- else if (ans==6)
- System.out.println("It is certain");
- else if(ans==7)
- System.out.println("My reply is no");
- else if(ans==8)
- System.out.println("As i see it yes");
- else if(ans==9)
- System.out.println("Most likely");
- else if(ans==10)
- System.out.println("You may rely on it");
- else if(ans==11)
- System.out.println("Cannot predic now");
- else if(ans==12)
- System.out.println("Beter not tell you now");
- else if(ans==13)
- System.out.println("Very doubtful");
- else if(ans==14)
- System.out.println("Outlook good");
- else if (ans==15)
- System.out.println("Yes definetly");
- else if(ans==16)
- System.out.println("Concentrate and ask again");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement