Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help with this code, only if you know how to do it 100% Dice game A game rolls a die 10 times and counts
please help with this code, only if you know how to do it 100%
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 payOut 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 - 4 4 payout = Your Function Save C Reset MATLAB Documentation 1 function payOut- diceGame( rolls) % Your code goes here % 4 5 end Code to call your function C Reset 1 tenRollsOfDice - randi(6,1,10) 2 payOutdiceGame( tenRollsofDice) Run Function FeedbackStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started