CSE 113 - Spring 2008 - Banner
   CSE 113 - Spring 2008 - Introduction to Computer Programming I
CSE 113 - Spring 2008 - Navigation CSE 113 - Spring 2008 - Assignments: Module 4

Module 4
Last modified: February 10 2008 04:40:57 PM

In this lab assignment you will:

  • Create your own Java source code file that manipulates a picture.

Lab Tasks

More detailed information about some of these tasks is available in Chapters 3 & 4 of the text. This set of tasks is not necessarily linear. You may have to go back and forth between editing and testing several times before moving on to the next step on the list.

  1. Create a file named PictureManipulator.java using the DrJava editor.
  2. In this file, create a class definition for a class named PictureManipulator.
  3. Inside the class, create a constructor that brings up a FileChooser and when the user selects a file, creates a Picture object from the file selected.
  4. Display the picture using the explore method.
  5. Save the file and test out what you have done by creating a PictureManipulator and seeing the results.
  6. You will then write the code to manipulate the picture object as described in steps 7 - 14. Insert the code for these steps in between the lines that create the picture and the line that brings up the picture explorer. This way, the picture explorer comes up with the results of the manipulation of the picture you have done.
  7. Get the pixel that is at 25, 25 and make its red component have the value 49.
  8. Save the file and test out what you have done by creating a PictureManipulator and seeing the results.
  9. Get the pixel that is at 3,3 and make its green component have the value 150.
  10. Save the file and test out what you have done by creating a PictureManipulator and seeing the results.
  11. Get the pixel that is at the bottom right corner of the image and double its green and blue component.
  12. Save the file and test out what you have done by creating a PictureManipulator and seeing the results.
  13. Get the pixel that is 10 pixels to the left and 15 pixels above the bottom right corner of the image and change its color to java.awt.Color.CYAN.
  14. Save the file and test out what you have done by creating a PictureManipulator and seeing the results.


Save Your File

You should save the file you created, named PictureManipulator.java into your own module4 directory.


Submission

You should make sure to name your class and save your file with the name PictureManipulator.java. Submit this file by going back out to the Unix prompt and typing:

submit_cse113 PictureManipulator.java


Due date

Your lab submission is due no later than 11:59:59 pm on February 29th. Remember, no late labs will be accepted.


Lab authored by Adrienne Decker

 

CSE 113 - Spring 2008 - Footer

 

 
Page Maintained by: Adrienne Decker