Mini Assignment: Magic 8 Ball

This assignment asks you to write an applet that replicates the classic Magic 8 Ball toy from the 1960’s.  Your program (like the original 8 Ball) will not really pay any attention to the user’s question—it will simply take the question and discard it.  Then it always gives one of several “canned” answers.  The original Magic 8 Ball had the answers printed on the sides of two eight sided dice.  These original answers are:

outlook not so good          don't count on it              my sources say no

without a doubt              reply hazy, try again          it is certain

my reply is no               as I see it yes                most likely

you may rely on it           cannot predict now             outlook good

better not tell you now      very doubtful                   

yes definitely               concentrate and ask again

For this assignment you will need to use random numbers. Here is the code:

Make sure that your program has good style: