Problem 6.9

Lottery Number Generator
A lottery commission offers four different lottery games to play: Three-number, Four-number, Five-number and Five-number + 1 lotteries. Each game has independent numbers. Develop an application that randomly picks numbers for all four games and displays the generated numbers in a GUI. Declare a method that generates a random number based on a range given, and returns the random number as a String. The games are played as follows:
a) Three-number lotteries require players to choose three numbers in the range 0-9
b) Four-number lotteries require players to choose four numbers in the range 0-9
c) Five-number lotteries require players to choose five number in the range 1-39.
d) Five-number + 1 lotteries require players to choose five numbers in the range 1-49 and an additional number in the range 1-42.

To develop an application that generates random numbers for the four lottery games and displays them in a GUI, you can follow these steps:

1. Start by creating a GUI for your application. Depending on the programming language you are using, you can use libraries or frameworks such as JavaFX, Tkinter (Python), or Windows Forms (C#) to create a GUI window to display the generated numbers.

2. Declare a method called `generateRandomNumber` that takes two parameters: `min` and `max` representing the range of numbers to generate. This method should generate a random number within the given range and return it as a string.

3. For the Three-number game, call the `generateRandomNumber` method three times with `min` as 0 and `max` as 9 to generate three random numbers. Display these numbers in the GUI.

4. For the Four-number game, call the `generateRandomNumber` method four times with `min` as 0 and `max` as 9. Display the generated numbers in the GUI.

5. For the Five-number game, call the `generateRandomNumber` method five times with `min` as 1 and `max` as 39 to generate five random numbers. Display these numbers in the GUI.

6. For the Five-number + 1 game, call the `generateRandomNumber` method five times with `min` as 1 and `max` as 49 to generate five random numbers. Additionally, call the `generateRandomNumber` method once with `min` as 1 and `max` as 42 to generate an additional number. Display all six numbers in the GUI.

7. Run the application and test the generated numbers for each game. Each time you run the application, the numbers should be different as they are generated randomly.

Note: The exact implementation details of the GUI and random number generation may vary depending on the programming language and libraries you are using.