Here is the problem: Create a console (standalone) application. This program wil
ID: 3535735 • Letter: H
Question
Here is the problem:
Create a console (standalone) application. This program will allow you to select MegaBall lottery numbers. For the first 5 numbers you will be requested to enter a number that is greater than zero and less than or equal to 56. However, there’s a catch! Each number must be different.
When any of the first five numbers is less than 0 or greater than 56 the user will receive a message to this effect and will be asked to reenter the number. You will create the code that will display one message when a number less than 1 is entered and a different message if a number greater than 56 is entered.
If the number is the same as any number entered before it (with the exception of the megaball number) the user will receive a message to this effect and asked to reenter the number. This is the same for the second through fifth numbers. I typed in the same number a couple of times so you will see what occurs when I do.
When entering the megaball number, if the number entered IS NOT between 1 and 46 then the user will receive a message to this effect and asked to reenter the number. One message will display if the number is less than 1, and a different if the number is greater than 46.
The following MUST be included in the program:
labels and text fields for the lottery balls
a JTextArea for the instructions
the menu item shown in the below figures
the labels, there are two, at the top of the frame
the button to download the numbers
the pop-up messages as shown in the figures
the borders shown in the figure. The panel holding the JTextArea is using a
titled border.
You must have multiple classes. One that contains the accessor and mutator methods, a readInput() method and a writeOutput() method. You will not use the mutator methods but include them anyway to show that you know how to write them. Name this first program “Megaball.javaâ€.
The second program is to be named “MegaballTest.java†and will be responsible for creating a Megaball object and calling the writeOutput() and readInput() methods from the Megaball class.