In order to write this or any other Java program of substance, you will need to know how to use the Java Platform, Standard Edition API Specification as well as the documentation for the Guzdial-Ericson Multimedia Class Library .
You may find other useful hints in my online tutorials and slides for this course as well as in the YouTube video lectures for this course.
Testing Your Programs
You can compile and execute your program by following the instructions given at Java OOP: The Guzdial-Ericson Multimedia Class Library .
Program Specifications
Program 1
Discussion
The following is a non-exhaustive list of concepts that you need to understand along with knowledge and skills that you need to possess in order tosuccessfully write this program and/or understand the given solution in Prob01.java . Some of these items are general in nature and some are specific to the use of Ericson's multimedia library. I won't repeat theitems that were listed with the programs in Practice Group 1 . Instead, I will concentrate on new concepts, knowledge, and skills not included in previouslists.
- How to design and implement an algorithm that will transform the original image into the image shown in Figure 1 .
- How to instantiate an object and call a method on that object in a single statement .
- How methods belonging to an object call other methods belonging to the same object.
- How to call a method on an object to modify the object saving only a reference to the modified object.
- The use of nested loops to access and modify image pixels on the basis of the horizontal and vertical coordinates of the pixels.
- How to create a mirror image of a portion of an image about a vertical line in the image.
- How to create a mirror image of a portion of an image about a horizontal line in the image.
Listing 1 - Write the Java application described below. |
---|
/*File Prob01 Copyright 2012 R.G.Baldwin Write a program named Prob01 that uses the class definition shown below and Ericson's media libraryalong with the image file named Prob01.jpg to produce the graphic output image shown in Figure 1 below. Click Prob01.java to download a Java source file containing the solutionto this program. In addition to the output image, your program must display your name and the othertext shown below on the command-line screen: Display your name here.
Picture, filename Prob01.jpg height 240 width 320*********************************************************/
public class Prob01{//DO NOT MODIFY THE CODE IN THIS CLASS DEFINITION.
public static void main(String[]args){
Picture pic = new Prob01Runner().run();System.out.println(pic);
}//end main method}//end class Prob01
//End program specifications. |
Figure 1 - Required output image for Prob01.
Program 2
Discussion
The following is a non-exhaustive list of concepts that you need to understand along with knowledge and skills that you need to possess in order tosuccessfully write this program and/or understand the given solution in Prob02.java . Some of these items are general in nature and some are specific to the use of Ericson's multimedia library. I won't repeat theitems that were listed with the programs in Practice Group 1 or earlier programs in this practice group. Instead, Iwill concentrate on new concepts, knowledge, and skills not included in previous lists.