<< Chapter < Page | Chapter >> Page > |
Revised: Sun Apr 03 14:24:32 CDT 2016
This page is included in the following Books:
This module is one of a series of modules designed to teach you about Object-Oriented Programming (OOP) using Java.
The program described in this module requires the use of the Guzdial-Ericson multimedia class library. You will find download, installation, and usageinstructions for the library at Java OOP: The Guzdial-Ericson Multimedia Class Library .
I recommend that you open another copy of this document in a separate browser window and use the following links to easily find and view the Figures and Listings while you are reading about them.
In this module, you will learn how to darken, brighten, and tint the colors in a Picture object.
Program specifications
Write a program named Prob04 that uses the class definition shown in Listing 1 and Ericson's media library along with the image files in the following list to produce the four graphic output imagesshown in Figure 1 through Figure 4 .
Figure 1 - Input file Prob04a.bmp.
Figure 2 - Input file Prob04b.bmp.
Figure 3 - Input file Prob04c.jpg.
Figure 4 - Required output image.
New classes
You may define new classes as necessary to cause your program to behave as required, but you may not modify the class definition for the class named Prob04 shown in Listing 1 .
Required text output
In addition to the four output images mentioned above, your program must display your name and the other line of text shown in Figure 5 on the command-line screen.
Figure 5 - Required text output. |
---|
Display your name here.
Picture, filename None height 293 width 392 |
This program uses a black ellipse on a green background (see Figure 2 ) as a pattern to cause the pixels in a snow scene (see Figure 3 ) at the location of the ellipse to be given a red tint and causes all other pixels inthe snow scene to be darkened (see Figure 4 ) .
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?