← Back

Code Challenge 9 - Magic 8-Ball


The Magic 8-Ball is a fortune-telling toy. You ask the 8-ball a question, shake it up, and a response is shown in a little window. Some example responses include:

Skills to Practice

Challenge Tasks

  1. Create a console project named CodeChallenge9Magic8Ball.
  2. Complete the folowing tasks:
    1. Prompt the user to enter a question. You don’t need to save the question, because we don’t actually use their question in any meaningful way. We’re just giving the user hope.
    2. Generate a random number. This random number will match up to some response.
    3. Depending on the random number, output an answer from the examples above. Include them all in your program.

Sample Output