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

  1. Chapter 1 notes, Exercise 9, parts 1 and 2.
    1. After completing Exercise 9, part 1, Inspect and print the Circle object by the following:
      1. Right-click on .
      2. Choose Inspect. The inspection window should appear as at right:
      3. Press Alt Prnt Scrn keys simultaneously. The screen will be written to the clipboard.
      4. Open Word.
      5. Type in your name, Homework 1, and the date.
      6. On a new page, paste the clipboard into Word.
      7. Save the Word document as: HW1
    2. Inspect and paste the inspection window for the Triangle object similarly.
    3. After completing Exercise 9, part 1, paste the house picture window by the following:
      1. Right-click the icon to open the house picture window.
      2. Press Alt Prnt Scrn keys simultaneously. The screen will be written to the clipboard.
      3. Paste the clipboard into HW1 Word document.
      4. Save HW1 document.
    4. Attach Exercise 9, part 2. That is the list of tasks you used to create a house picture.
  2. Chapter 1 notes, Exercise 14. You may need to redo Exercises 10-13 first if your work from the class is not available.
    1. Change the draw method to add a sunset of a sun.
      • Use the slowMoveVertical(int) method.
    2. Compile by right-clicking Compile button.
    3. 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.
  3. Be sure to complete the previous Assignment 2 immediately above first.
    1. 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:
      1. Create an instance of class Picture named picture1.
      2. Call the setSunGreen method.
      3. Open the icon to see the results.
    2. Copy the Picture class source code by the following:
      1. Right-click Picture class
      2. Open Editor
      3. Drag over the Java code.
      4. Copy and paste into the Word document, HW1.
      5. Save HW1 document.

Turn in

  1. Page 1- Your name, date, and Homework 1 should be on the first page.
  2. Class and Screen results - Follow the instructions for Assignment 1-3; copy and paste specified results into the Word document.
  3. C201 OnCourse Dropbox - Place the Word document in C201 OnCourse dropbox as HW1.