Question: Write matlab script. Assume that winning numbers for this week's Powerball lottery is: WB = [01, 25, 28, 31, 54] & PB = 02 Write
Write matlab script. Assume that winning numbers for this week's Powerball lottery is: WB = [01, 25, 28, 31, 54] & PB = 02 Write a MATLAB script that asks the user to provide the White Balls numbers and Power Ball number on his/her ticket and reports the prize according the following rules: if only PB number matches, then prize is $2 if PB and 1 of the WB numbers match, then prize is $4 if PB and 2 of the WB numbers match, then prize is $7 if 3 of WB numbers match, then prize is $7 if PB and 3 of the WB numbers match, then prize is $100 if 4 of WB numbers match, then prize is $100 if PB and 4 of the WB numbers match, then prize is $50,000 if 5 of WB numbers match, then prize is $1,000,000 if PB and all the WB numbers match, then it is a Jackpot. The program first needs to make sure that inputs are valid numbers, i.e. 5 non-repetitive positive integers between 1 and 69 for WB numbers and one positive integer between 1 and 26 for PB number.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
