Question: Create the code for a Magic 8 Ball game in which the user enters a question such as What does my future hold? The computer

Create the code for a Magic 8 Ball game in which the user enters a question such as "What does my future hold?" The computer randomly selects one of eight possible vague answers, such as "It remains to be seen".

HINT: Create an array of 8 answers; The logic:

  • Ask user to input a question
  • Get a random number between 0 and 7
  • Display the answer from the array for that random number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!