Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Dice game A game rolls a die 1 0 times and counts how many times the number 5 or 6 shows up . If there

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 =
5,6,1,6,4,1,2,4,6,6
payout =
1
Function (?
Save
C. Reset
(i) MATLAB Documentation
function payout= diceGame( rolls )
% Your code goes here %
tenRollsofDice =1,2,3,4,5,6,1,2,3,4;
payout =1;
end
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

Echo staff performs exam (23 minutes).

Answered: 1 week ago