Question: Instructions: Using a MATLAB script ( NOT a LiveScript ) , solve the following problem. Name your file Lab 2 1 _ YourLastName and submit

Instructions: Using a MATLAB script (NOT a LiveScript), solve the following problem. Name your file
Lab21_YourLastName and submit both the .m and .pdf files to Canvas.
Assignment:
You will create a program for the user to play a coin toss game using only a mouse for control and no
keyboard input. The program will have the following characteristics:
Display images of the heads and tails side of a coin in a figure.
Create a separate UI figure containing a radio button interface with two buttons--Play and Quit. When
Play is selected, the user wants to continue playing after the current round. When Quit is selected the
user wants to quit after the current round. This is checked by the program at the end of each round
before proceeding to the next round.
Provide a text prompt on the figure at the start of each round telling the user to left click on the image
for heads or tails to make the bet.
When a bet is detected, use randi() to determine what comes up when the coin is tossed.
Provide a text prompt on the figure at the end of the round informing the user whether they won or
lost.
The program continues until ended by the user using the Quit radio button.
Instructions: Using a MATLAB script ( NOT a

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 Accounting Questions!