Homework 1
Objects and Classes
|
Modified:
|
Overview - The purpose of the first homework is to review Chapter 1
concepts and practice skills needed throughout the course.
Assignment
- Chapter 1 notes, Exercise 9, parts 1 and 2.
- After completing Exercise 9, part 1, Inspect and print
the Circle object by the following:

- Right-click on
.
- Choose Inspect. The inspection window should appear as at
right:
- Press Alt Prnt Scrn keys simultaneously. The screen will be
written to the clipboard.
- Open Word.
- Type in your name, Homework 1, and the date.
- On a new page, paste the clipboard into Word.
- Save the Word document as: HW1
- Inspect and paste the inspection window for the Triangle
object similarly.
- After completing Exercise 9, part 1, paste the house picture
window by the following:
- Right-click the
icon to open the house picture
window.
- Press Alt Prnt Scrn keys simultaneously. The screen
will be written to the clipboard.
- Paste the clipboard into HW1 Word document.
- Save HW1 document.
- Attach Exercise 9, part 2. That is the list of tasks you used to
create a house picture.
- Chapter 1 notes, Exercise 14. You may need to redo Exercises 10-13 first if
your work from the class is not available.
- Change the draw method to add a sunset of a sun.
- Use the slowMoveVertical(int) method.
- Compile by right-clicking Compile button.
- Create an instance of class Picture named picture1.
- Call the draw method.
- Open the
icon to see the results.
- Call the draw method again to see the sunset.
- Be sure to complete the previous Assignment 2 immediately above first.
- Add the Picture method to the source code named
setSunGreen with no parameter that sets the color of the sun
field to green. Test by:
- Create an instance of class Picture named picture1.
- Call the setSunGreen method.
- Open the
icon to see the results.
- Copy the Picture class source code by the following:
- Right-click Picture class
- Open Editor
- Drag over the Java code.
- Copy and paste into the Word document, HW1.
- Save HW1 document.
Turn in
- Page 1- Your name, date, and Homework 1 should be on the first
page.
- Class and Screen results - Follow the instructions for Assignment 1-3; copy and paste
specified results into the Word document.
- C201 OnCourse Dropbox - Place the Word document in C201 OnCourse
dropbox as HW1.