Write a java applet that
does the following functions based on a hard coded variable named
"play". Example code: " int play = 1; "
You do not need to use any keyboard I/O. Each time the code is ran, I will
change the value of play to test your code. You do not need to use thekeyboard.classas stated in the textbook.
If you want to use some of the example code above (How to get user input) to add keyboardinput for this assignment that is fine but not
- When play = 1 draw one blue circle on the right and display the
following text below the circle on the left hand side:
"If all our misfortunes were laid in one common heap, whence everyone
must take an equal portion, most people would be content to take their own
- When play = 2 draw two green box's 40 pixels wide on the right and
display the following text below the box's on the left hand side:
"There are only two ways to live your life. One is as though nothing
is a miracle. The other is as though everything is a miracle."
-- Albert Einstein
- When play = 3 draw three gray lines 70 pixels long on the right and
display the following text below the lines on the left hand side:
"We are like butterflies who flutter for a day and think it's
- When the value of play is <= 100 but not
1, 2, or 3 display the following text on the left hand side:
"I haven't failed, I've found 10,000 ways that don't work."
- When the value of play is > 100 and
<= 1000 display the following text on
the left hand side:
"Any science or
technology which is sufficiently advanced is indistinguishable
--Arthur C. Clarke
- When the value of play is >1000 display the following text on the left hand side:
Sorry, Value is out of Range!
--Your Name Here
Make sure your name is
at the top of the program as a comment. Submit only the .java file when it is