CSCI 201 Homework 5

Downloading files to get started

Start out with the Java program called Oct17 that was discussed in the October 17 lecture. Save this program in a file named HW5.java on your computer. It is important to use capital letters in the HW5 part of the file name.

For these assignment, you'll also need two images that have the same width and height. You can use the two used in class if you wish. You must remember the name of the directory in which you store your files!

colors1.gif colors2.gif
#1 #2

Initial modification of the program

Find the line gives the class name of your program and change the Oct17 to be HW5.

public class Oct17 {

Next find the two lines that give the names of the image files you'll use in your program. Change them to the real file names as they appear on your computers. Windows users must double any backslashers used in their file names.

    String p1Name = "G:\\Pictures\\colors1.gif" ;
    String p2Name = "G:\\Pictures\\colors2.gif" ;

Run your program

Run your program and make sure it works like the one demonstrated in class. If it doesn't, send email to the instructor. If you wait until the last minute to start this assignment and this initial run doesn't work, you'll be in trouble.

When the program runs it should blend your two pictures as shown below:
#1     +     #2     =     blend

Your job

Your homework assignment is to add at least two more picture combinations. A few examples are shown below:

checkers stripes target
checkers stripes bulls eye

Each of your new combination must be implmented by a new method and each much involve either an if or some very interesting mathematical expression. One of your combination methods can be taken from the textbook, but one must be your own work!

Due date and turning it in

This assignment is due by class on Halloween (October 31). Submit your assignment using the UNCA Moodle to the assignment labeled "Homework 5 -- Combining images".