Simple Java Homework

SoccerBoss
Category:
Other
Price: $10 USD

Question description

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 required.

  • 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 and depart."
    -- Socrates
     
  • 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 forever."
     
    --Carl Sagan.
  • 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."
    --Thomas Edison
     
  • 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 from magic."
    --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 working. 

Studypool has helped 1,244,100 students
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1831 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors