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.
Sections 5.2.2 - 5.2.3 and 5.3 (pp. 134-149, 167-170) from the course textbook.
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.
The following objectives should be mastered by each student DURING and FOLLOWING the class session through active work and practice.
copyPictureTo
method to create a collage using these pictures.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.
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...
}
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.