Question: Use your knowledge of MATLAB to create script files for the following problems. Submit your script files via email on or before the due date.
Use your knowledge of MATLAB to create script files for the following problems. Submit your script files via email on or before the due date. As with any assignment in this course, please contact me with any Questions you may have. You recently won $50 in a raffle. Instead of putting it in the bank like you know you should, you decide to go down to the racetrack and see how many races your money can last. The race track has horse races all summer long with each race consisting of 5 horses. You must wager $10 on each race. The horses with the highest chance of winning will always have lower payouts, while the horses with the lowest chance of winning will always have the highest payouts. The race track always places the horses with the best chance of winning in position towards the middle of the gates. Assume the following conditions are true for all races. The horse in gate 1 will always have a 16% of winning and a payout of $35. The horse in gate 2 will always have a 20% of winning and a payout of $30. The horse in gate 3 will always have a 28% of winning and a payout of $20. The horse in gate 4 will always have a 24% of winning and a payout of $25. The horse in gate 5 will always have a 12% of winning and a payout of $40. Write a MATLAB program that will ask for the user to pick a horse (1, 2, 3, 4, or 5) and then will use the "rand" or "randi" command to determine the winner of the race. After each race, the program will adjust the total money accordingly, display it to the user, ask the user to pick a new horse, and continue on with the next race with a new random number. This will continue until a balance of under $10 is reached. When a balance under $10 is reached, have MATLAB output to the user how many races their money lasted and the maximum possible they could have won if they guessed correctly every time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
