In Blue j 1. Create a new class named Scene. 2. Add a main method to the Scene class that simply creates a new Scene object like this: Scene scene = new Scene(); This should be all that is in main at this point. 3. Add a public method named animate that has no parameter variables and returns nothing. Leave the body blank for now. (Hint: What should the return type of animate be?) 4. Add two House fields to Scene. Call them house1 and house2. 5. Add a sun field that can reference a Circle object. 6. Add a moon field that can reference a Circle object. 7. Create a no-arg constructor for the Scene class that creates the two House objects shown in the image below. Use the methods you created in the preceding activity to position and color the houses exactly as in the image. We will adopt the convention that house1 refers to the left house and house2 refers to the right house. 8. Add a sun to the upper-left corner of the scene. (Create the sun object and set the color, position, and size in the no-arg constructor.) 9. When you run main, what appears in the resulting image should match the above exactly. (We are not testing your creativity. We are testing your ability to follow directions. You will be given an opportunity to be creative in the postLab :-) ) 10. In the animate method, move the sun across the sky until it moves completely off the right edge of the window using the slowMoveHorizontal method for the sun object. Add a call to animate in your main method just below the line that creates the Scene object. Now when you run main you should see the sun move across the sky.  Add a blue moon object similar to how you added the sun. Place the moon initially off the screen to the left of the sun. You could just copy the sun code and then move moon horizontally. In animate, after the instruction that moves sun across the sky, make moon move slowly across the sky and stop above house2

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter10: Object-oriented Programming
Section: Chapter Questions
Problem 19RQ
icon
Related questions
Question

In Blue j

1. Create a new class named Scene.
2. Add a main method to the Scene class that simply creates a new Scene object like this:
Scene scene = new Scene();
This should be all that is in main at this point.
3. Add a public method named animate that has no parameter variables and returns nothing. Leave
the body blank for now. (Hint: What should the return type of animate be?)
4. Add two House fields to Scene. Call them house1 and house2.
5. Add a sun field that can reference a Circle object.
6. Add a moon field that can reference a Circle object.
7. Create a no-arg constructor for the Scene class that creates the two House objects shown in the image
below. Use the methods you created in the preceding activity to position and color the houses exactly
as in the image. We will adopt the convention that house1 refers to the left house and house2 refers
to the right house.

8. Add a sun to the upper-left corner of the scene. (Create the sun object and set the color, position, and
size in the no-arg constructor.)
9. When you run main, what appears in the resulting image should match the above exactly. (We are
not testing your creativity. We are testing your ability to follow directions. You will be given an
opportunity to be creative in the postLab :-) )
10. In the animate method, move the sun across the sky until it moves completely off the right edge of
the window using the slowMoveHorizontal method for the sun object. Add a call to animate in your
main method just below the line that creates the Scene object. Now when you run main you should
see the sun move across the sky. 

Add a blue moon object similar to how you added the sun. Place the moon initially off the screen to
the left of the sun. You could just copy the sun code and then move moon horizontally. In animate,
after the instruction that moves sun across the sky, make moon move slowly across the sky and stop
above house2

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Running Time of Application
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage