subject
Engineering, 24.03.2020 03:25 vibezkj

The lottery game matches three different numbers between 1 and 10. Winning depends on how many matching numbers are provided by a player. The player provides three different numbers between 1 and 10. The player doesn’t have to guess the order of numbers. The payout rules for the lottery are:

If there is a match of all 3 numbers, the winning $ 1000.If there is a match with 2 numbers, the winning $ 10.If there is a match of all with 1 numbers, the winning $ 1.With no match, the winning is $0.Write a function Lottery3 that checks three numbers provided by a player and determine the winning amount. If the user mistakenly enters same number twice/thrice and if that number matches one of the winning numbers, the code should count that number only once and display correct result. The player doesn’t have to guess the order of numbers. The input to the function Lottery3 can have up to two input arguments. The first input argument is a row array numbers with 3 numbers. If the second argument input testCode is present, and is a row vector of 3 values, the function Lottery3 uses the code in testCode as the three winning numbers (the test must be three different integer numbers between 1 and 10), else three different numbers will be automatically generated by testCode. The ouput should return the variable winnings and the three winning numbers in the row array winNumbers. Hint: Make use of the internal function any. Restriction: The function must use switch-case statements to determine the winning.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Water at 70°f and streams enter the mixing chamber at the same mass flow rate, determine the temperature and the quality of the exiting stream. 0 psia is heated in a chamber by mixing it with saturated water vapor at 20 psia. if both streams enters the mixing chamber at the same mass flow rate, determine the temperature and the quality of the existing system.
Answers: 2
question
Engineering, 04.07.2019 19:10
Asteam is contained in a rigid tank with a volume of 1 m3. initially, the pressure and temperature are 7 bar and 500 oc, respectively. the temperature drops due to cooling process. determine: (1) the temperature at which condensation begins in °c, (2) the fraction of the total mass that has condensed when the pressure decreased to 0.5 bar. (3) the volume in m3 occupied by saturated liquid at the final state?
Answers: 3
question
Engineering, 04.07.2019 19:10
The sum of the normal stresses does not change as the stress state rotates through an angle. a)-trune b)- false
Answers: 2
question
Engineering, 04.07.2019 19:10
Which of the following is the most important advantage of a large field of view? a. allows larger areas to be examined b. relieves eyestrain c. minimizes parallax errors. d. increases precision in proportion to the in- crease in field of view
Answers: 2
You know the right answer?
The lottery game matches three different numbers between 1 and 10. Winning depends on how many match...
Questions
question
Mathematics, 25.12.2019 15:31
Questions on the website: 13722362