Question
C++ language 1. Create a Magic 8-Ball program. Ask the user to first think of a yes/no question and then press any key to continue.
C++ language
1. Create a Magic 8-Ball program. Ask the user to first think of a yes/no question and then press any key to continue. Once they press a key, generate a random number between 0-6 (inclusive), and use a switch statement to print out one of the following statements. Feel free to use an enum to make your program read easier.
Absolutely NOT! No I dont think so Hmmm maybe? I believe so Yes Hell YES! Example Output Think of a yes/no question. Press any key to continue... Absolutely NOT!
2. Create a program to simulate level difficulty. Each level of difficulty of your game will have a different number of enemies, though that number is random. Ask the user which level of difficulty they would like to play. Use a switch to process their choice. Generate a random number of enemies for your game, but generate a number in a higher range for harder levels of gameplay.
Example Output
Difficulty Levels 1) Easy 2) Medium 3) Hard Whatll it be? 1 Youll have to fight 6 enemies! Difficulty Levels 1) Easy 2) Medium 3) Hard Whatll it be? 3 Youll have to fight 27 enemies!
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