Question
THE PROGRAM SHOULD BE IN C++ LANGUAGE.. Write a program that simulates a Magic 8 Ball, which is a fortune-telling toy that displays a random
THE PROGRAM SHOULD BE IN C++ LANGUAGE.. Write a program that simulates a Magic 8 Ball, which is a fortune-telling toy that displays a random response to a yes or no question from the user. The program should ask the user to ask a yes or no question, and then display one of the responses randomly from an array of 12 responses. The program will continue to ask the user questions and respond until the user types in DONE. NOTE: Sample code for generating a random number between 1 and maxNum can be found on page 130-131 of the assigned text book (9th edition).book name -starting out with C++ The array of responses should contain the following 12 responses: o Yes, of course! o Without a doubt, yes. o You can count on it. o For sure! o Ask me later. o Im not sure. o I cant tell you right now. o Ill tell you after my nap. o No way! o I dont think so. o Without a doubt, no. o The answer is clearly NO. An example run might be: Welcome to the Magic 8 Ball. Ask a question that requires a YES or NO response, and I will tell you what I think! When you are finished, just say DONE. What is your Question? Will I win a million dollars? For sure! What is your Question? Will I be late for work? You can count on it. What is your Question? DONE Thank you for playing Magic 8 Ball! Practice using functions that you learned in Chapter 6 to make your program more modular and easier to read. Remember: Include several test runs of the program to show successful runs of your program, with both valid and invalid data (to show that you are checking for invalid data) Please ensure the program is well designed and follows accepted style guidelines (e.g. variable naming, indentation, spacing). Please ensure the program is well documented, including the overall purpose of the program and documenting all the major sections of the code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started