look at paper instruction for details.

The Lottery Problem

A lottery requires that you select seven different numbers from the integers 1 to 35. A separate powerball number should also be generated. The powerball number should be within the range of 1-10. Write a Java program that will do this for you and generate eight sets of seven numbers plus one powerball number. You must create an array and you must use the random() method in your solution. The solution must also include the use of at least one repetition statement.

Details:

For generating random numbers you can use the random() static method of class Math. It returns a double so you will need to cast it as an integer. If you set the range to 35, you can generate a random number between 1 and 35 through:

number = (int) ( range * Math.random() ) + 1;
Note that you need eight sets of numbers and in each set you have should have seven different numbers – plus a powerball number. There should not be duplicate numbers within each set of seven. Of course the same number can occur in multiple sets, but within the same set of 7 numbers it should only occur once, if at all.

Here is an example of a valid set of numbers: 5, 33, 3, 9, 22, 30, 15, 3

The first seven numbers must be unique and within the range of 1-35. The last number is the powerball number. The powerball number may be a duplicate and that is fine. It must range between 1-10.

Here is an example of an invalid set of numbers: 15, 8, 19, 33, 8, 21, 18, 6

It is invalid because the number 8 appears twice in the set of seven.

Your assignment submittal should include your Java program with commented Java source code files.

Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.

[order_calculator]