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

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Aloaded platform of total mass 500 kg is supported by a dashpot and by a set of springs of effective stiffness 72 kn/m. it is observed that when the platform is depressed through a distance x = 12.5 cm below its equilibrium position and then released without any initial velocity; it reaches its equilibrium position in the shortest possible time without overshoot. find the position and velocity of the loaded platform 0.10 sec. after its release. if a further load of 400 kg is added to the platform, find, i) the frequency of damped vibrations, and i) the amplitude of vibration after 2 complete oscillations, given that the initial amplitude is 15 cm.
Answers: 1
question
Engineering, 04.07.2019 18:20
Most leaks in reciprocating air compressors can be detected and minimized by: (clo4) a)-detecting leakage areas using ultrasonic acoustic detector. b)-tightening joints and connections c)-replacing faulty equipment d)-all of the given options
Answers: 2
question
Engineering, 04.07.2019 18:20
Select any two (2) areas of applications of chain-drive. (clo4) a)-permanent lubrication necessary b)-hydraulic forklift truck operation c)-rigging and heavy moving materials d)-relatively high maintenance costs e)-costlier than belt drives
Answers: 2
question
Engineering, 04.07.2019 19:10
Estimate the change in specific internal energy au and specific enthalpy h from inlet to outlet for ethylene glycol (a liquid) flowing through each of the following devices: (a) a heat exchanger where the glycol temperature increases from 20 °c to 80 °c; (b) a pump operating at about 25 °c and increasing the glycol pressure from 100 kpa to 8 mpa.
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
question
Mathematics, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
Physics, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
Biology, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
English, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
Biology, 18.09.2020 05:01
question
English, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
History, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
question
Mathematics, 18.09.2020 05:01
Questions on the website: 13722360