Question
5. Chapter 8, Problem 3 (Magic 8-Ball) // Filename: MagicEightBall.m A Magic 8-Ball uses an icosahedral (twenty-faced polyhedron) die floating in a dark liquid to
5. Chapter 8, Problem 3 (Magic 8-Ball) // Filename: MagicEightBall.m A Magic 8-Ball uses an icosahedral (twenty-faced polyhedron) die floating in a dark liquid to randomly produce an answer to a yes-or-no question. Write a program MagicEightBall.m that simulates this. Use a cell array of strings to store the twenty possible responses shown as follows and randomly select an answer to display to the user. It is decidedly so You may rely on it It is certain Yes-definitely Most likely Signs point to yes Better not tell you now Don't count on it Outlook not so good Reply hazy, try again Cannot predict now My reply is no Very doubtful Without a doubt As I see it, yes Yes Ask again later Concentrate and ask again My sources say no NOTE: For this problem, you only have to choose 10 of the responses to enter and randomly choose from - you may choose more if you'd like to!
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