Java program to simulate a pick 3, 4 or 5 lottery drawing

profileEngineer_Ankit
 (Not rated)
 (Not rated)
Chat

 Write a Java program to simulate a pick 3, 4 or 5 lottery drawing. A lottery game of this type

will draw values between 0 and 9. You should use the Math.Random() or the java.util.Random() class to

generate the values in the lottery drawing. The program should prompt the user for which lottery game

they want to play. The program should also ask how many times they want to play the game. The output

should show the numbers picked for each game and the sum of the numbers of all games. Here is a

sample run:

Which lottery game do you want to play (Enter 3 for pick-3, 4 for pick-4 or 5 for pick-5? 3

How many games would you like to play? 10

Thank you! The numbers selected were:

3 4 9

2 4 7

3 3 1

0 3 2

9 3 1

9 2 4

4 5 2

1 1 0

0 1 7

8 6 3

The sum for all numbers picked was: 107

    • 10 years ago
    Assignment Completed with ScreenShots of Running Code
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      lottery_testplan_screenshots.doc
    • attachment
      homework2a.zip
    • attachment
      homework2a.doc