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 15:10
Apiston-cylinder with a volume of 0.25 m3 holds 1 kg of air (r 0.287 k/kgk) at a temperature of 100 c. heat transfer to the cylinder causes an isothermal expansion of the piston until the volume triples. how much heat is added to the piston-cylinder?
Answers: 3
question
Engineering, 04.07.2019 03:10
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
question
Engineering, 04.07.2019 18:20
Inspection for bearing condition will include: (clo4) a)-color b)-smell c)-size d)-none of the above
Answers: 1
question
Engineering, 04.07.2019 18:20
Steam enters a converging nozzle at 3.0 mpa and 500°c with a at 1.8 mpa. for a nozzle exit area of 32 cm2, determine the exit velocity, mass flow rate, and exit mach number if the nozzle: negligible velocity, and it exits (a) is isentropic (b) has an efficiency of 94 percent
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
History, 20.09.2020 05:01
question
Mathematics, 20.09.2020 05:01
question
Mathematics, 20.09.2020 05:01
question
Health, 20.09.2020 05:01
question
Mathematics, 20.09.2020 05:01
question
World Languages, 20.09.2020 05:01
question
Mathematics, 20.09.2020 05:01
question
Mathematics, 20.09.2020 05:01
Questions on the website: 13722363