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, 03.07.2019 14:10
Explain the difference laminar and turbulent flow. explain it with the shear stress and the velocity profiles.
Answers: 1
question
Engineering, 03.07.2019 14:10
The y form of iron is known as: a) ferrite b) cementite c) perlite d) austenite
Answers: 3
question
Engineering, 04.07.2019 18:10
Give heat transfer applications for the following, (i) gas turbines (propulsion) ) gas turbines (power generation). (iii) steam turbines. (iv) combined heat and power (chp). (v) automotive engines
Answers: 1
question
Engineering, 04.07.2019 18:10
Calculate the bore of a cylinder that has a stroke of 18 inches and an extension time of 6 seconds at a flow rate of 4 gal/min.
Answers: 3
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, 14.07.2020 01:01
question
Mathematics, 14.07.2020 01:01
question
Mathematics, 14.07.2020 01:01
Questions on the website: 13722367