Engineering
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])

answer
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 15:10, EmilySerna
Heat is added to a piston-cylinder device filled with 2 kg of air to raise its temperature 400 c from an initial temperature of t1 27 cand pressure of pi 1 mpa. the process is isobaric process. find a)-the final pressure p2 b)-the heat transfer to the air.
Answers: 1
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 03:10, lauriepdx17
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
image
Engineering, 04.07.2019 18:10, lillygrl100
For the closed feedwater heater below, feedwater enters state 3 at a pressure of 2000 psia and temperature of 420 °f at a rate of ix10 ibhr. the feedwat extracted steam enters state 1 at a pressure of 1000 psia and enthalpy of 1500 btu/lbm. the extracted er leaves at an enthalpy of 528.7 btu/lbm steam leaves as a saturated liquid. (16) a) determine the mass flow rate of the extraction steam used to heat the feedwater (10) b) determine the terminal temperature difference of the closed feedwater heater
Answers: 3
Do you know the correct 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: