Java BigLotto Program


Design a program BigLotto that prompts the user for how many Lotto tickets he/she wants. Use a loop to create the tickets. Create a static method createLottoTicket that creates and returns one Lotto ticket as a String. For the Lotto ticket you must create an array size 6. You must generate 5 random numbers 1-47 using the SecureRandom class and place them in the array. Then you must generate a random mega number 1-27 and place it last in the array. Create a String containing the 6 random numbers and return it. You must print each Lotto ticket in main. Use the command prompt (console) for input and output.

For example, if the user requests 2 Lotto tickets the output would be:

*******************

17   4  29  42  36  21

*******************

*******************

24  16  47  41  3   14

*******************

Leave a Reply

Your email address will not be published. Required fields are marked *



  • File Format: .java
  • Lines of Code: 46