Overview

In this reading we’ll continue to explore ways in which we can use the 2D representation of a Picture, namely through creating collages and blending images together.

Note that this reading is mostly in the form of example programs. I strongly recommend you take the time to type these programs up and test them using DrJava. This will take you a bit of time but will help you understand the code in more depth than simply reading through it.

Required Reading

Sections 5.2.2 - 5.2.3 and 5.3 (pp. 134-149, 167-170) from the course textbook.

Learning Objectives

BASIC Learning Objectives

Each student will be responsible for learning and demonstrating proficiency in the following objectives PRIOR to the class meeting. The reading quiz will test these objectives.

  1. Given a Java method, identify its method signature.
  2. Given two Java methods with the same name, determine if those methods may be overloaded.

ADVANCED Learning Objectives

The following objectives should be mastered by each student DURING and FOLLOWING the class session through active work and practice.

  1. Given several pictures, use the copyPictureTo method to create a collage using these pictures.

Pre-class Exercises

These exercises are geared towards mastering the BASIC learning objectives listed above. You are expected to submit them before class and it is highly recommended that you complete them before attempting the reading quiz.

  1. For each of the following two Picture methods, give the method signature.

    public void amazingFilter(int startX, int startY)
    {
        // some code here...
    }
    
    public int changeThePicture(Picture anotherPic)
    {
        // some code here...
    }
  2. Consider the following two Java methods:

    public int satsGreatFilter(int foo, int bar)
    {
        // some code here...
    }
    
    public void satsGreatFilter(int x, int y)
    {
        // some code here...
    }

    Is it valid to have both of these methods in our Picture.java file at the same time? Explain why or why not.