CIS 174                                                        LAB ASSIGNMENT  #8
Assigned date: Thursday 3/20
Due date: Thursday 3/27
40 points

Lab 8.1 [30 points]

Write a method named createCollage to create a collage of the same images and/or images with the same size onto the 7x95in.jpg blank. One of those images can be the original picture. The others should be modified forms. You can do any scaling, cropping,  rotating the image; creating a negative of the image; shifting or altering the color on the images. Your single method called createCollage should make all of this happen. The collage should have at least four images.
You are required to create the following methods in the class Picture. Save your collage to a file ( PictureObj.save(filename).

Method copy:
public void copy(Picture sourcePic, int startSourceX, int startSourceY, int endSourceX, int endSourceY, int xStart, int yStart)
startSourceX, starSourceY, endSourceX and endSourceY defining the portion of the object sourcePic would be copied to the target picture.
xStart and yStart are the positions to start the copy into on the target picture.

Method createCollage
public void createCollage( ) - call method copy in the method createCollage.

Deliverables:

Lab 8.2 [10 points]

Write a method for Turtle to draw a Rectangle and calculate the area of the rectangle with different approaches.

  1. Passing in no argument - Define or input the length and width in the method, draw the rectangle and display the area.
  2. Passing in no argument - Define or input the length and width in the method, draw the rectangle and return the area.
  3. Passing in the length and width  - Draw the rectangle, calculate and display the area.
  4. Passing in the length and width   - Draw the rectangle, calculate and return  the area.

Write the main method to test each approach.


 

 

.