CS 140 - Homework 6 - Due Thursday October 30

In this homework you are going to write a program that tiles a large, originally blank picture with a smaller picture. Here's the result of running the program on a small file named wave.jpg in the thumbnails folder in the gallery we've been using.

Requirements

  1. This is a harder program and will be worth 15 points.
  2. Your program should be named in a file HW6.java
  3. Your program should prompt the user for the name of the file they want tiled. The user should not enter the ".jpg" extension.
  4. Your program should prompt the user for the number of times they want the picture tiled horizontally.
  5. Your program should prompt the user for the number of times they want the picture tiled vertically.
  6. To help you, write a method in the picture class named copyInto that takes three parameters, the x and y coordinate of where you want to place a single instance of the picture, and the larger picture object we are copying into. For example, if pic is the smaller picture and tiled is the larger picture then the line
       pic.copyInto(x,y,tiled);
    
    copys pic into tiled starting at upper left location x,y in the picture tiled.
  7. Your program should animate the tiling.
  8. Turn in a stapled prinout of your Picture.java file and your HW6.java file.
  9. Make sure you copy your Picture.java file and your HW6.java file on your T: drive.

Here is what the user input of my version of the program looks like:

  Enter in the thumbnails folder you want to tile: wave
  How many times horizontal: 4
  How many times vertical:  3

You can run my version of the program by double clicking on run.bat in the folder T:/Harcourt/Fall2008/CS140/HW6/ and entering the input into the black console window.