Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this assignment you are to write a program to simulate playing the lottery game PowerBall. The rules for PowerBall can be found by clicking
For this assignment you are to write a program to simulate playing the lottery game PowerBall. The rules for PowerBall can be found by clicking on this link: http:/lwww.mnlottery.com/games/lotto games/powerball or by clicking on this link: http://www.powerball.com all/pb howtopla Prizes and Odds of Winning Match 5 of 5 Powerball 5 of 5 numbers 4 of 5 Powerball $50,000 4 of 5 numbers 3 of 5 Powerball 3 of 5 numbers 2 of 5 Powerbal S7 1 of 5+ Powerball Powerball ONLY Win JACKPOT1 in 292,201,338 $1,000,000 1 in 11,688,054 Approx. Odds 1 in 913,129 1 in 36,525 1 in 14,494 1 in 580 1 in 701 1 in 92 1 in 38 $100 $100 57 S4 What vou must do: You are to ask the user to input their numbers for the PowerBall drawings. Your program needs to perform input validation for each number entered by guaranteeing the number has not already been chosen and that it is a valid number for the lottery game PowerBall. The first five numbers must be between 1 and 69 inclusive and the powerball must be between 1 and 26 inclusive. The first five numbers are the white balls and the powerball is the red ball 1. Your program will simulate the PowerBall drawing by using a random number generator to randomly select the 5 white balls and the one red ball for the lottery game. The program must guarantee each number generated for any of the five white balls has not already been selected. If the number has already been selected your program should generate a new number. You do not need to do this with the PowerBall number since onlv one number is selected. 2. For this assignment you are to write a program to simulate playing the lottery game PowerBall. The rules for PowerBall can be found by clicking on this link: http:/lwww.mnlottery.com/games/lotto games/powerball or by clicking on this link: http://www.powerball.com all/pb howtopla Prizes and Odds of Winning Match 5 of 5 Powerball 5 of 5 numbers 4 of 5 Powerball $50,000 4 of 5 numbers 3 of 5 Powerball 3 of 5 numbers 2 of 5 Powerbal S7 1 of 5+ Powerball Powerball ONLY Win JACKPOT1 in 292,201,338 $1,000,000 1 in 11,688,054 Approx. Odds 1 in 913,129 1 in 36,525 1 in 14,494 1 in 580 1 in 701 1 in 92 1 in 38 $100 $100 57 S4 What vou must do: You are to ask the user to input their numbers for the PowerBall drawings. Your program needs to perform input validation for each number entered by guaranteeing the number has not already been chosen and that it is a valid number for the lottery game PowerBall. The first five numbers must be between 1 and 69 inclusive and the powerball must be between 1 and 26 inclusive. The first five numbers are the white balls and the powerball is the red ball 1. Your program will simulate the PowerBall drawing by using a random number generator to randomly select the 5 white balls and the one red ball for the lottery game. The program must guarantee each number generated for any of the five white balls has not already been selected. If the number has already been selected your program should generate a new number. You do not need to do this with the PowerBall number since onlv one number is selected. 2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started