Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that winning numbers for this week's Powerball lottery is: WB = [01, 25, 28, 31, 54] & PB = 02 Write a MATLAB script

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions