The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
University
| Teaching Since: | Apr 2017 |
| Last Sign in: | 438 Weeks Ago, 2 Days Ago |
| Questions Answered: | 9562 |
| Tutorials Posted: | 9559 |
bachelor in business administration
Polytechnic State University Sanluis
Jan-2006 - Nov-2010
CPA
Polytechnic State University
Jan-2012 - Nov-2016
Professor
Harvard Square Academy (HS2)
Mar-2012 - Present
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 cor-rect! or Sorry, you are wrong. In either case also display The secret number was: followed by the secret number. Use labels for these three mes-sages. The program will have a private instance variable secret Number of type long that holds the secret number. You will need to set it in the f nit method using the following line of code:
![]()
In the action Perforued method, check which button was pressed and make the appropriate response label visible. After that, make the two but-tons invisible (only one guess is allowed) and the label containing the secret number visible.
Â
-----------