Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Powerball Number Generator For this assignment youre going to create a console application called A03PBallGenerator. This app is going to mimic a quick pick program

Powerball Number Generator

For this assignment youre going to create a console application called A03PBallGenerator.

This app is going to mimic a quick pick program in a lotto terminal. When the user runs your app youre going to select the numbers for them. Then youll ask them if theyd like another set of numbers. Y for yes and N for No. Use a do while loop so that if they type a lowercase or uppercase y then you will give them a new set of numbers replacing the original ones. If they type anything else then exit the program.

Powerball rules: In each game, players select five numbers from a set of 69 white balls and one number from 26 red Powerballs; the red ball number can be the same as one of the white balls. Your app is going to randomly choose five numbers from the white ball pool (169) and one from the red ball pool (126). Heres the catch, you cant repeat any of the white numbers. So if you find a duplicate then you have to keep choosing until you have a unique value. When you have your five unique values then Id like you to sort those values in ascending order. In other words, if your app chose 65, 2, 33, 14, 64 then youll sort those so they show as 2, 14, 33, 64, 65. For the red ball you just randomly choose from 126.

Here is a function that will return a number between (and including) the min and the max. So if you pass in 1 and 69 as arguments then youll get a number between (and including) 1 and 69 and youll get 1 to 26 (inclusive) if you pass in 1 and 26 for min and max. Leave the randomNumber declaration outside of the method. public static Random randomNumber = new Random(); //Global, outside of any methods.

static int getRandomIntInclusive(int min, int max)

{

return (randomNumber.Next(min, max + 1));

}

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_2

Step: 3

blur-text-image_3

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

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions

Question

Were all members comfortable brainstorming in front of each other?

Answered: 1 week ago

Question

4. What will the team agreement contain?

Answered: 1 week ago