Lab 3: Magic 8-Ball

For this lab we will be implementing Magic 8-Ball game.

Given 8 messages stored in an array of strings, your program will either prompt the user for a number (in part 1) or generates some random number(s) (in part 2 and 3), then display corresponding messages from the array.

Submission Instructions:

Please write your name and the name of your partner in the comment section at the top of your code. Before leaving the class, make sure every member of the group has marked its project (even the empty project) as complete by clicking on the "Education" menu (top middle) and then on the "Mark as Completed".

Part 1, 1 point

Prompt for user input for an integer in the range 0..7. Display the message that corresponds to this value.

Sample run:

Welcome, let Magic 8-Ball show you the way! Think of a question, then enter a number in the range 0..7: 6

6. No way, do not proceed with that plan.

Part 2, 1 point

Comment out the prompt. Instead now generate a single random number using rand() in the range 0..7. Display the corresponding message from the messages array, and the program ends.

Sample run:

Think of a question, then hit enter key to get a message.

2. Yes, go ahead and make that phone call.

Part 3, 1 point (extra credit)

Add a loop to your program, to continue selecting and displaying more numbers and random 

messages until option 6 gets randomly selected, at which point the program ends.

Sample run:

Hit enter key to get more messages.

5. Absolutely, go ahead.

0. Get ready, you are about to learn something new.

1. New friends are on their way.

1. New friends are on their way.

2. Yes, go ahead and make that phone call.

6. No way, do not proceed with that plan.