Question: Using matlab, write an a code that satisfies this statement: Slot machines are popular gambling attractions in which you spin 3 wheels that have several
Using matlab, write an a code that satisfies this statement:
Slot machines are popular gambling attractions in which you spin 3 wheels that have several images on them.When the wheels stop, if the 3 images that are showing are all the same then you win the jackpot.Suppose you have decided to spend one hour playing the slot machine.You have figured that you can play a maximum of 200 times within one hour.
You arrive at the slot machine with 10 dollars. It costs 25 cents (0.25 dollars) to play one turn. If you get 3 of the same image, then you win 15 dollars. You will continue to play the game until the hour is up, or until you run out of money. Afterward, you want to know how many games you played, how many times you won, and how much money you have.
Write a code that simulates your experience playing the slot machine. After you finish, display the information you wanted in a sentence: After playing ___ number of times, I won ____ games, and left with ____ dollars
Assume the slot machine has 3 wheels, and each wheel has 8 images. For a single wheel, you have an equal chance of obtaining each of the 8 images; it is completely random. For ease in programming, represent the 8 images with numeric values 1 through 8.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
