Create an applet or GUI application that plays a simple guessing game. Give it two buttons labeled Odd and Even. The user must guess whether a secret number is odd or even by clicking one of these buttons. After a guess is made, the applet should display either Congratulations, you are correct! or Sorry, you are wrong. In either case, also display The secret number was: followed by the secret number. Use labels for these three messages.
The program will have a private instance variable secretNumber of type long that holds the secret number. You will need to set it in the init method using the following line of code:
secretNumber = java.util.Calendar.getInstance().getTimeInMillis() % 100;
In the actionPerformed method, check which button was pressed and make the appropriate response label visible. After that, make the two buttons invisible (only one guess is allowed) and the label containing the secret number visible.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.