Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 =
5616412466
payOut =
1

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

Step: 3

blur-text-image

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

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions