Dice game A game rolls a die 10 times and counts how many times the number 5 or 6 shows up. If there are - a total of seven or more times, the win is 2 dollars. - a total of four or more times but...


Please answer in matlab code.


Dice game<br>A game rolls a die 10 times and counts how many times the number 5 or 6 shows up. If there are<br>- a total of seven or more times, the win is 2 dollars.<br>- a total of four or more times but less than seven, the win is 1 dollars.<br>- a total of three or less, the win is 0 dollars.<br>Write a function called diceGame that has an input row array of 10 integers representing the ten rolls of dice, and calculates the pay out.<br>For example:<br>>> tenRollsOfDice =randi(6,1,10)<br>>> payout= diceGame( tenRollsOfDice )<br>tenRollsofDice =<br>6<br>1<br>4<br>1<br>2<br>4 6 6<br>payout =<br>1<br>Function e<br>Save<br>C Reset<br>MATLAB Documentation<br>1 function payout= diceGame( rolls )<br>2<br>3<br>% Your code goes here %<br>4<br>5 end<br>

Extracted text: Dice game A game rolls a die 10 times and counts how many times the number 5 or 6 shows up. If there are - a total of seven or more times, the win is 2 dollars. - a total of four or more times but less than seven, the win is 1 dollars. - a total of three or less, the win is 0 dollars. Write a function called diceGame that has an input row array of 10 integers representing the ten rolls of dice, and calculates the pay out. For example: >> tenRollsOfDice =randi(6,1,10) >> payout= diceGame( tenRollsOfDice ) tenRollsofDice = 6 1 4 1 2 4 6 6 payout = 1 Function e Save C Reset MATLAB Documentation 1 function payout= diceGame( rolls ) 2 3 % Your code goes here % 4 5 end

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here