Question: ~~~~~~~~~Posted below is a problem in MATLAB, please answer and provide the correct coding and functions. Thanks!~~~~~~~~~~~~~~ Problem 2: dice777 Game is a very simple
~~~~~~~~~Posted below is a problem in MATLAB, please answer and provide the correct coding and functions. Thanks!~~~~~~~~~~~~~~

Problem 2: dice777 Game is a very simple game played with two dice. The player simply bets on whether the sum of the two dice when rolled will be Under 7, Over 7, or Equal to 7. Write a function called dice777. To help you shuffle the dice well, include this command in your code: rng( shuffle'). Make sure you initiate this command before you roll your dice. This command randomly seeds the random function you will be using to generate the results of the dice. Your function will prompt the user to input how much money he/she wishes to wager. Also prompt the user to place his/her bet: Under 7, Over 7, Equals 7. Before the user places the bet, provide the user with the rules of the game as shown below in the output printout. Once the bet is placed, the dice is rolled twice and the sum of the rolls are calculated to determine a win or a loss. Use the following to roll your dice: Dicel randi [i 6,1); Dice2 randi([1 6,1); [Note: randi li 6,1) creates one integer value in the range of 1 to 6]. The payout depends on the bet. If the player correctly bet Under 7 or Over 7, the payout is 1:1 (i.e., if the user bets S5 he/she wins $5. If the player correctly bets Exactly 7, the payout is 10:1 (i.e., if one bets S10, the win is $100). You may want to cap how much one can bet. Below is a sample run and the corresponding output dice 777 How much money do you want to bet $1 to $10:10 Betting rules: Select 1 if you think the sum of the two dice will be LESS than 7 Select 2 if you think the sum of the two dice will be MORE than 7 Select 3 if you think the sum of the two dice will be EXACTLY 7 And your bet is 3 Ro You won your bet and your payout is $100 9%%%%, %%6%6% 9%
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
