You are to write a program name mega Million.java. You can use vectors or arrays as your data structure. Here are some requirements for the program:
- The program must prompt the user to enter the amount of tickets he/she wants to purchase (must be between 1 and 5)
- A ticket will be made up of two sets of numbers - a group of 5 numbers and another group of 1 number.
- The numbers must be randomly generated from the range of 1 - 56 for Group 1 and 1 - 46 for Group 2.
- There must be no repetition of numbers in the same group.
- However, if the user wants for example 2 tickets, then it is possible for these two tickets to differ by only 1 number (so repetition between tickets are allowed providing that the 2 tickets are not identical).
- You are to use vectors or arrays to store the lottery numbers.
- The program must also prompt the user asking him/her if he/she wants to buy more tickets. If answer is "yes" rerun the program. If "no" terminate the program.Sort the numbers in Group 1 in ascending order for each ticket purchased.Then display all of the tickets purchased by the user on the screen in the order of Group 1 followed by the single number in Group 2.