Question: How do I write this on matlab?? a) Create a string variable and assign to it your favorite color b) Write Matlab code that prompts

How do I write this on matlab??  How do I write this on matlab?? a) Create a string

a) Create a string variable and assign to it your favorite color b) Write Matlab code that prompts the user to guess your favorite color. After the user has had 3 attempts, the program displays the message "Incorrect. You run out of chances!" and stops. For example, let's assume you set your favorite color as blue, when you run your code the output could look like this: >>Guess my favorite Color: red Incorrect. Try again >> Guess my favorite Color: yellow Incorrect. Try again >> Guess my favorite Color: green Incorrect. You run out of chances! Another scenario: >> Guess my favorite Color: blue Your guess is correct. Bravo

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!