1. Create a new class named Scene. 2. Add a main method to the Scene class...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. L 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 im below. Use the methods you created in the preceding activity to position and color the houses exac as in the image. We will adopt the convention that house1 refers to the left house and house2 ref to the right house. BlueJ Shapes Demo X 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. 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. L 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 im below. Use the methods you created in the preceding activity to position and color the houses exac as in the image. We will adopt the convention that house1 refers to the left house and house2 ref to the right house. BlueJ Shapes Demo X 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. 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. L 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 im below. Use the methods you created in the preceding activity to position and color the houses exac as in the image. We will adopt the convention that house1 refers to the left house and house2 ref to the right house. BlueJ Shapes Demo X 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.
Expert Answer:
Answer rating: 100% (QA)
Algorithm Initialize the Scene Create a new Scene object Create Houses Inside the Scene object create two House objects house1 and house2 Create Celestial Objects Create a sun and a moon object as Cir... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
A regular language is a language that can be defined by a regular expression. 0 2 . 1 Complete the unshaded cells of Table 1 to show which of the statements about regular languages are true and which...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Karamazov Semiconductors is considering an investment to expand its existing line of business. The investment will cost $10 million and is expected to produce after-tax cash flows of $1 million per...
-
Consider two binomial distributions, with n trials each. The first distribution has a higher probability of success on each trial than the second. How does the expected value of the first...
-
Show that the parametric equations x = 2sint and y = 3cost define an ellipse.
-
Refer to the information in Exercise 16-14. Prepare journal entries dated June 30 to record: (a) raw materials purchases, (b) direct materials usage, (c) indirect materials usage, (d) direct labor...
-
In Kagan Company, materials are entered at the beginning of each process. Work in process inventories, with the percentage of work done on conversion costs, and production data for its Sterilizing...
-
Sales for a new car is expected to grow according to the equation: S = 150000(1-e -0.06t ), where t = months i) Calculate the number of cars sold after one year. ii) Calculate the number of cars sold...
-
3. In column G, Brett wants to calculate the number of days the invoice is overdue. If the age of the invoice is greater than 30 days, it is overdue. Calculate the days overdue as follows: a. b. C....
-
RPM manufactures racks for CDs. Costs are $13.90 per rack. A wholesaler buys CD racks from RPM at $24.80 each, then sells them at $36.30 to retailers. The retailer sells the racks for $45.60 each to...
-
A company sells an asset for $10,000 at the end of a project. It originally paid $30,000 for that asset, and up to the time the asset was sold it had taken a total of $15,000 in depreciation chagres...
-
An investor in a local company receives a copy of the company's financial statements. The information clearly shows the company earned a profit in the last period, but the accompanying letter states...
-
The fixed assets account of Brothers Inc. has a balance of $100,000 and $120,000 at the end of year 2016 and year 2015, respectively. The accumulated depreciation account balances are $50,000 and...
-
I. SIMPLE INTEREST: 1. How much is the amount and the accrued simple interest of $ 18,950; at 6.585% for seven years and nine months? 2. Find the difference between the exact simple interest and...
-
In class we discussed the following example of valuing the goodwill amortization in M&A: Term 15 Cost of debt 0.07 Tax 0.40 Example ($ ) Stock Purchase Price $60,000,000 Purchase Price Allocation...
-
26. Table 1below shows the results of a hypothetical 10-question test given to a group of students. Where is the 1st quartile point? (a) At the transition between scores of 1 and 2. (b) At the...
-
Suppose you need to answer any four of seven essay questions on a history test and you can answer them in any order. a. How many different question combinations are possible? b. What is the...
-
A regular polygon is an n-sided polygon in which all sides are of the same length and all angles have the same degree (i.e., the polygon is both equilateral and equiangular). The formula for...
-
Write a program that simulates picking a card from a deck of 52 cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King) and suit (Clubs, Diamonds, Hearts,...
-
Create a table named Salary as follows: Obtain the data for salary from?http://cs.armstrong.edu/liang/data/Salary.txt?and populate it into the?Salary?table in the database. create table Salary(...
-
Describe a commercial banks assets and liabilities.
-
Financial intermediaries can manage the problems of adverse selection and moral hazard. a. They can reduce adverse selection by collecting information on borrowers and screening them to check their...
-
Define bank capital and key measures of bank profits and returns.
Study smarter with the SolutionInn App