Change Contents of the Bubble
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Homeworks-Fall 2005

All homework are due by 10 pm on the due date!

HW1: Implement one new image method in Picture


DUE DATE: Wed 7 Sept

Create a new method in the class Picture that implements some kind of image manipulation. You must use a for loop in your method! The picture that gets manipulated should be the target that receives the method (i.e., this). For example, if you implement the method "mytweak()", then you'll use it on some picture somePicture.mytweak(), and you'll expect the picture somePicture to change. (Don't bother returning a DIFFERENT picture for this method.)

What manipulation that gets implemented is entirely up to you: Increasing blue while decreasing red, flipping vertically, posterizing, etc. You must implement something NOT already implemented in the class Picture. You can use the methods that are there as examples.

Turn your implementation of the class Picture via WebCT. Name your method something that makes sense for what it does. Put your method at the bottom of the class definition, with a comment before it indicating your name and what your method does.

Did you make an interesting picture with your first method? Please consider sharing it in the Gallery HW1: First picture method-Fall05

Ask Questions on HW1-Fall2005 here.


HW2: Create a Picture collage


DUE DATE: Wed 14 Sept

Implement a class with a static public void main() method that, when executed, creates and shows a collage of pictures. You need to have one picture appear four times: The original time, then three other times with some image manipulation. You're welcome to add additional pictures if you'd like. Mirroring the canvas horizontally or vertically often improves the composition of the collage, but is not necessary.

Your method can call FileChooser.setMediaPath() and then use FileChooser.getMediaPath() to access pictures.

Turn in your PictureCollage class, any additional pictures that you add to your media folder to create your collage, and your Picture class if you end up adding any additional methods to it. Turn in via WebCT.

Please consider sharing your collage on the Gallery HW2: Picture collage-Fall05

Ask Questions on HW2-Fall2005 here.


HW3: Create music


DUE DATE: Fri 23 Sept

Create a song using the JMusic package. Your song:

Extra Credit: Up to 10 points extra credit if one of the parts is generated algorithmically. If you just have random notes, you'll get 1 point. If you have random notes that match duration (i.e., the random part doesn't go longer than the other parts), you get 5 points. If your notes are actually sonorous (not dischordant) with the rest of the piece and you have a mix of note durations (but still doesn't go longer), you can get up to 10 points.

Implement your music in a MyFourPartSong class in a main method. At the end of your main method, .notate your song. From the notation window, you can write out the MIDI to upload and share with others.

Turn in your MyFourPartSong Java file via WebCT. Comments are important here! Include comments with:
  1. Your name and GT-email address
  2. Explaining what you're doing – help your TA figure out what's going on!

Please consider sharing your song in the Gallery HW3: Four Part Music-Fall05

Ask Questions on HW3-Fall2005 here.


HW4: Use Weaving and Repeating to Create Music


DUE DATE: Fri 30 Sept

Using the methods developed in class to play with linked list of music, create a song.

You only have to use SongNode and have a single part with a single instrument.
For +5 points extra credit, use the SongPart class and create your song with more than one part and instrument.

You will create a class (with some cunning name like MyWovenSong) with a main that will assemble your song, then open it with showFromMeOn. (If you use Song and SongPart, you'll use show instead of showFromMeOn.) Please put comments in your class:
  1. With your name, GT-email address
  2. Explaining what you're doing

Turn in to WebCT:

Please consider sharing your song (by saving out the MIDI) in the Gallery HW4: Woven Music-Fall05

Ask Questions on HW4-Fall2005 here.


HW5: New Picture List Manipulations


DUE DATE: Fri 7 Oct

Using any of the linked lists of pictures that we created (where ordering represented linearity, or layering, or using turtles to walk the list), implement three additional methods:

You must also provide a class named PictureTest that has a main() method which utilizes all three of your new methods. When the grader executes the main(), it should (a) show a background with three or more pictures in it, (b) then show a new picture after weaving a new element into it, and (c) a third picture with some new pictures inserted at the end, then (d) a final fourth picture after using findAndInsertRepeat.

Extra Credit 5 points: Make some of your methods work with PositionedSceneElement, and use them to create a long pattern of smallish images via weaving and repeating, in order to create an interesting tiling on a long picture (e.g., at least 1000 pixels long). Say "dog, dog, house, dog, dog, tree–repeat." Show a fifth picture of some long picture with the tiling pattern appearing on it.

Please put comments in your class before each of the methods that you create:
  1. With your name, GT-email address
  2. Explaining what you're doing:

Turn in to WebCT:

Ask Questions on HW5-Fall2005 here.


HW6: Create an animation with sound effects


DUE DATE: Wed Oct 19

Note: This is a big program. Don't leave it for the last minute!

Create an animation with sounds associated with frames.
THERE MUST BE AT LEAST 20 FRAMES IN YOUR ANIMATION.

Here's how to do it:

You can use and modify any of the data structures that we've described in class. To get sounds to link up right, you'll want to use this SimpleSound: SimpleSound.java It has a better blockingPlay(). Download it and put it in your

You will also need to create a class (maybe AnimationRunner?). Your TA will create an instance of this class (AnimationRunner ar = new AnimationRunner()).


Please put comments in your classes and before each of the methods that you create:
  1. With your name, GT-email address
  2. Explaining what you're doing

Turn in to WebCT:

If you send me (Mark Guzdial) your files when you're done, I'll create a movie from your animation and post it at Gallery HW6: Animation with sound-Fall05. If you want to do it yourself, here's one way of doing it:

Ask Questions on HW6-Fall2005 here.

HW7: Build a Graphical User Interface (GUI) for REMOVEDging a Picture


DUE DATE: Fri Nov 4

You must write HW7 using Pair Programming. Announce your pair at Student187. Not working in a pair is a 5% score penalty (i.e., you lose five points from the start.)

Build a class named PictureTool whose constructor takes in a filename as input. You'll use it like this:
Welcome to DrJava.
> PictureTool pt = new PictureTool("D:/cs1316/mediasources/swan.jpg");


You should then (a) make a picture from that filename, (b) open it, and (c) (here's the part that you work at!) open a window with "Tools" in it. These tools should be buttons that will manipulate the picture. It'll look something like this:
External Image

You get to choose what tools that you provide, but there must be at least four:
  1. Provide some tool for manipulating the color: Reduce red, increase red, make it grayscale, make it negative, darken, or lighten. Your choice. (You can provide more than one – maybe lighten and darken?)
  2. Provide a tool that takes a numeric input and uses that input to manipulate the picture. Maybe it's a scaling tool and the input is amount to scale (2.0? 0.5?)? Maybe it's an amount to increase or decrease red?
  3. Provide a tool to do some kind of mirroring, either horizontal or vertical.
  4. One other tool of any kind you want. Flip? Red eye removal? Compose a Bratz doll scaled down into the bottom? Chromakey the picture into a jungle?

Everytime that we click one of these tools, the picture should be manipulated and then repainted! We want to see the change after clicking the tool.


Hint: If you need to convert the String from a text field into a Double (with a floating point, like for scaling), you can use Double.parseDouble(String) like this:
> Double.parseDouble("3.45")
3.45



You must also provide a "Save" button that should save the resultant picture back onto the original filename. (Suggestion: Only do this on COPIES of pictures that you want to manipulate!)

Last time, people wanted to show off their cool tools. Feel free to take a picture of your tool and share it here: Gallery HW7: Picture Tools-Fall05

Please put comments in your classes and before each of the methods that you create:
  1. With your name, GT-email address
  2. Explaining what you're doing

Turn in to WebCT:

Ask Questions on HW7-Fall2005 here.



HW8: Simulate immigration into another country


DUE DATE: Wed 16 Nov

You must write HW8 using Pair Programming. Announce your pair at Student187. Not working in a pair is a 5% score penalty (i.e., you lose five points from the start.)

Using the Simulation Package developed in class, create a simulation of immigration behavior.

Setup

When running
Let's consider a timestep to be about a month. Run the simulation for 10 years (120 timesteps). Here are the starting (amazingly simplistic) rules.

Experimentation
You need to build Agent and Simulation subclasses to implement this scenario. But you have to explore and try different things in your simulation.

Things that you might want to try changing in your rules:
OvercrowdingMaybe there are more people to start with, or it takes more near neighbors to convince someone that they're overcrowded, or more timesteps of crowded conditions to convince them to move
Crop failuresWhat if crop failures were more common, or it took multiple consecutive crop failures to convince someone to emigrate.
TravelWhat if people didn't die on the trip over, or if it took longer
MovementWhat if people moved more often, or further, in either America or Europe.
DiseaseIn America, it was more likely crowded conditions that led to disease. What if people moved like they do in Europe, and they all came ashore at the same 2 or 3 spots, and then the incidence of disease was dependent on the number of people around you?

In addition to your program, you are to produce a Word file with graphs of all NINE of your runs – that's three runs of each of three sets of variables. Show all three variables – Europeans, in-transit, and Americans per timestep for all three of the scenarios that you explored. Explain what you changed in each scenario and why you think the results differed from the other scenarios.

Generate this simulation as a series of JPEG frames, so that we can create a movie from them! You can upload your movies to Gallery HW8: American Emigration-Fall05

Please put comments in your classes and before each of the methods that you create:
  1. With your name, GT-email address
  2. Explaining what you're doing

Turn in to WebCT:
Ask Questions on HW8-Fall2005 here.

EXTRA CREDIT: You can get +5 extra credit points for adding the additional variables of wealth and cost to the simulation and coming up with reasonable rules for how this wealth is used in the simulation. Europeans have a normal distribution of wealth, but the least wealthy are more likely to get sick, more likely to have crop failure, and are more likely to want to emigrate. The most wealthy are the least likely to want to emigrate, are less likely to have crop failure, and are less likely to get sick. Once in America, wealth still plays a factor (most of the Founding Fathers were quite wealthy by their standards). Wealth plays less of a role in movement, but still plays a role in whether you get sick and die. If you decide to go for the extra credit points, please explain what rules you implemented and why – and you still have to explore

HW9: Simulate a stampeding crowd


You must write HW9 using Pair Programming. Announce your pair at Student187. Not working in a pair is a 5% score penalty (i.e., you lose five points from the start.)

DUE DATE: Fri 2 Dec

Using the simulation package developed in class, and replacing the turtle with character images, create a stampeding crowd scene simulation.

SetUp

During the Simulation
Let's imagine that a time step is a minute. Run the simulation for 30 minutes.

Generate this simulation as a series of JPEG frames, so that we can create a movie from them! You can upload your movies to Gallery HW9: Crowd Stampede Movies-Fall05

Please put comments in your classes and before each of the methods that you create:
  1. With your name, GT-email address
  2. Explaining what you're doing

Turn in to WebCT:

EXTRA CREDIT: There is no requirement to have different types of villagers, but I'll offer up to 10 points extra credit for having three or more types (e.g., maybe 5 points for two types.) One type of villager might look younger and move faster, another might look older and move slower. And maybe there's a maniacal kind that keeps heading for the obstacles! Mark Guzdial

Ask Questions on HW9-Fall2005 here.

Links to this Page