subject
Engineering, 14.11.2019 19:31 hindjssnsk

You are playing a game where you roll a fair dice 7 times. we set the sum of maximum value and minimum value as s. if s is 2, 5, or 12, you win 3 times s dollars; that is respectively 6,15, or 36. if s is 7 or 11, you win 2 times s dollars; that is respectively 14 or 22. if s is anything else, you win no money. write a function, called dicegame, which takes in a vector representing the dice values and returns the amount of money won.

for example: m = dicegame([1 2 3 4 5 6 1]) should return m = 14

m = dicegame([[1 1 1 1 1 1 1]]) should return m = 6

m = dicegame([2 1 2 2 5 1 5]) should return m = 0

test your program for the following three cases:

m = dicegame([5 1 2 3 4 6 6])

m = dicegame([6 6 6 3 4 2 5])

ansver
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 23:20, abbz13
Two technicians are discussing the intake air temperature (iat) sensor. technician a says that the computer uses the iat sensor as a backup to the engine coolant temperature (ect) sensor. technician b says that the powertrain control module (pcm) will subtract the calculated amount of fuel if the air measures hot. who is correct
Answers: 3
image
Engineering, 04.07.2019 18:10, yasminothman02
An air conditioning system consist of a 5 cm diameter pipe, operating at a pressure of 200 kpa. the air initially enters the pipe at 15°c with a velocity of 20 m/s and relative humidity of 80%. if the heat supply throughout the process is 960 w, determine the relative humidity and the temperature at the outlet
Answers: 3
image
Engineering, 06.07.2019 03:10, iiisavageoreo
Two slings are used to lift a girder of length l and uniform weight per unit length. what is the best position for the slings if the bending moment due to the weight of the girder is to be kept to a minimum?
Answers: 2
image
Engineering, 06.07.2019 03:20, shelbellingswo
Aload of 10kn is to be suddenly applied to the free end of a vertical rod of length 500 mm, the upper end being rigidly fixed. 190 mechanical science what should the diameter of the rod be if the maximum stress in the rod is not to exceed 100 mpa? the tensile modulus of the rod is 205 gpa.
Answers: 2
You know the right answer?
You are playing a game where you roll a fair dice 7 times. we set the sum of maximum value and minim...

Questions in other subjects: