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

Homeworks-Fall 2007

PLEASE REVIEW: Collaboration Policy, Homework Policy-Fall07


Homework 8: Zombie Attack Simulation [Questions] [Criteria]
Homework 7: Random Collage Generator GUI [Questions] [Criteria]
Homework 6: Demo Time! [Questions]
Homework 5: New Picture List Manipulations [Questions] [Criteria]
Homework 4: Use Weaving and Repeating to Create Music [Questions] [Gallery] [Criteria]
Homework 3: More Turtles [Questions] [Gallery] [Criteria]
Homework 2: Create a Picture collage [Questions] [Gallery] [Criteria]
Homework 1: Implement two new image methods in Picture [Questions] [Gallery] [Criteria]
Homework 0: Setup [Questions] [Gallery] [Criteria]

HW8: Zombie Attack Simulation

DUE DATE: Wednesday Dec. 5

Back to the top

You must write HW8 using Pair Programming. Not working in a pair will result in automatic 30% score penalty.

Using the provided Simulation Package (Simulation, Agents, etc), write a new class ZombieAttackSimulation that extends Simulation and modify the PersonAgent class and implement the following:
You and your partner must implement these rules and note the number of zombies and the number of surviving people. Start with 99 people and 1 zombie. Run the simulation for 100 timesteps and record the number of zombies and the number of surviving people. Do this for a total of 3 runs and average your numbers (You will have 4 datasets: 1st run, 2nd run, 3rd run, and average).

The goal is then increase the number of people that survive and decrease the number of zombies. You and your partner must implement TWO of the below special tactical maneuvers. You and your partner should implement one of the maneuvers, try out three runs and compute the average number of people and zombies. Then you must implement a second maneuver on top of the other one. You and your partner must then produce a Word document with graphs of the number of the normal people and zombies for each of the 100 timesteps of each run.

The Word document should have:


Extra Credit +10pts:
Option 1: Above and beyond performance on HW8

Option 2: Take CS Survey



Ask Questions on Questions on HW8-Fall07 here.

Back to the top

HW7: Random Collage Generator GUI

Back to the top

DUE DATE: Friday, November 16, 2007

You and your partner will be creating a random collage generator using the Java GUI classes that we have been learning in class. Before writing the program you will create subfolders in your MediaSources folder with a number of topics ("flower", "motorcycle", "Britney Spears", etc.). You should have 10-12 topics with about 3-5 pictures for each and your directory structure should look like this (assuming your MediaSources folder is "c:\cs1316\MediaSources\"):
etc..Notice that the topic is the subfolder and the images have a strict naming system (this will make them easier to choose).

You are now ready to start building your collage generator. Your GUI will allow users to choose 3-5 of these words (via a list, or selection of buttons, or typing them in, your choice but it must be graphical), and then randomly selects pictures from those directories, randomly applies filters for them, and randomly creates a collage with those manipulated images, then opens it up as a picture.

Turn in to TSquare:

Ask Questions on HW7-Fall07 here.

Back to the top

HW6: Demo Time!

Back to the top

DUE DATE: Demos starting Friday October 26

You and your partner will be signing up for a time with a TA to show off your progress on programming some methods that test the learning objectives of the class. Some examples of the types of things you will have to program are listed below. You won't have to do all 5, probably somewhere around 3 simple methods.

1.) Write a static method to calculate and print out the statistics of a set of numbers. The numbers will be integers and sent to you in an array. The statistics you need to calculate are average, min, max, and standard deviation. The method signature will be:
public static void printStatistics(int [] numbers)

2.) Simulate the tossing of 2 dice 5000 times and return an array of how many times each sum comes up. The array should be of length 13 (0-12) even though 0 and 1 are not possible sums. The method signature will be:
public static int[] tossDice()

3.) Write a new method in the PositionedSceneElement that replaces the node at a specified position with a new node. Both the index to replace and the new node will be sent as parameters and the index will be greater than 1 because it is not possible to remove or replace the first node. The method signature will be:
firstnodeinlist.replace(int index, PositionedSceneElement newNode)

4.) Write some simple classes that are related (parent child). One example would be writing Person and Student classes where a Person has:
The Student will be a subclass of Person and have:

5.) A simple (very simple) TurtleDance with music.

There isn't anything to turn in. Sign up for your HW6 Demo Time - Fall 2007

Ask Questions on HW6-Fall07 here.

Back to the top

HW5: New Picture List Manipulations

Back to the top

DUE DATE: Fri Oct. 19

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 (where firstpicturnodeinlist is a node, not actually a picture):

Note: oldelement or findelement will never be equal to the firstnodeinlist

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 using findAndReplaceRepeat, and (c) a third picture after using replaceWithModification, then (d) a final fourth picture after using replaceWithModifications.

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 TSquare:

Part 2: Find a partner for your pair programming assignments

Ask Questions on HW5-Fall07 here.

HW4: Use Weaving and Repeating to Create Music

Back to the top

DUE DATE: Friday Oct. 5

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. It does not need to autoplay!

You will create a class (with some cunning name like MyWovenSong) with a main that will assemble your song, then open it with showFromMeOn (or show–whatever you need to do open up the notation View on your masterpiece). Please put comments in your class:
  1. With your name, GT-email address
  2. Explaining what you're doing

Part 2 - Short answer questions:
1.) What is a NullPointerException? Why might one occur?

2.) What are two advantages of a linked list?

3.) Say we have a list of A>B>C>D>null. The steps to inserting a node (E) between nodes B and C are:
	Point E's next to C
	Point B's next to E

Why is it important that we do the steps in that order?

Turn in to T-Square:

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

Ask Questions on HW4-Fall2007 here.

Back to the top

HW3: More Turtles

Back to the top

DUE DATE: Wednesday September 26th

Part 1: Create a dance, complete with music

Using Sounds and the Turtles, create a musical dance. Play Sounds while the turtles move in patterns.

For Part 1 turn in your file via TSquare. 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 and dance in the Gallery HW3: Turtle Dance-Fall07.

Part 2: Debugging Code
My teacher has asked me to make a simple simulation of the ninja turtles going to pickup pizzas. I am supposed to make 4 Turtles named and located at:
There they will drop a picture of a pizza (he gave us a picture Uploaded Image: pizza.jpg)

Splinter (also simulated by a Turtle) will watch the whole thing. Contrary to popular believe the Ninja Turtles are not Maryland fans, so they like to have the Georgia Tech fight song playing in the background (included as wreck.wav).


I think I have a really great start on it, but it is due soon and I need it fixed. I am getting some compile errors, and there are also some runtime errors that I need fixed. Here is what I have written so far ( and my professor wants it to look like this:
Uploaded Image: GoJackets.JPG

To Turn in for Part 2
A corrected file named
A log of your thought process and bugs you found named Part2.txt


Ask Questions on HW3-Fall2007 here.

Back to the top

HW2: Create a Picture collage [Critera]

DUE DATE: Tuesday September 11, 2007

Back to the top

Create a class with a public static void main(String[]args) 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 are welcome to add additional pictures.

The whole collage should be mirrored in some direction so that it will be, for example, symmetric horizontally or vertically. However you may NOT use any of the mirror methods in You have to place elements so that everything gets mirrored appropriately.
We require you to use Turtle to do at least some of your drawing.

Hint: If you use two turtles to move and drop everything, a mirrored, symmetric picture will result.

You should include comments at the top of your class definition as well as throughout your public static void main(String[]args) method explaining what your code is doing or what your code should be doing.

Your method must use FileChooser.getMediaPath() to access pictures. Do not include FileChooser.setMediaPath() with your submitted code or you will get points off!

For +5 Extra Credit: Create your collage with diagonal symmetry or make a really really cool collage

In case you are unfamiliar with the idea of symmetry, here is a picture with the axes of symmetry each image drawn in.

More examples available here and also in the Spring 2007 Gallery


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

Ask Questions on HW2-Fall07 here.

Back to the top

HW1: Implement two new image methods in Picture

DUE DATE: CHANGED! Friday August 31, 2007

Back to the top

Write two new methods in the class Picture that implement some kind of image manipulation.The two methods can not be the same. You must use a for loop in one method and a while loop in the other! 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. In other words, we expect both of your methods to be void methods.)

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, but do not make any calls to those existing methods to implement your new methods.

Turn in file via TSquare. Name your methods something that makes sense for what it does and place those names in the top comments region of the class definition. Place your methods at the bottom of the class definition, with a comment before it indicating what your method does.

The TA grading this homework will compile your file in DrJava and test it using the interactions pane. They will create an instance of a Picture, execute each of your defined methods on that Picture object and show() the results.



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

Ask Questions on HW1-Fall07 here.

Back to the top

HW0 - Setup

DUE DATE: As soon as possible. It doesn't need to be turned in, but why not do it right now?

Back to the top
Download and setup Dr. Java using the instructions

Get used to the Interactions pane (on the bottom of Dr. Java)
The Interactions pane can be used to run simple java commands without setting up a whole class.
Go ahead and try it out. Type:
	System.out.println("Hello World.");

and press enter. System.out.println(..) is used to output to the terminal and is very useful for simple debugging.

Now try creating two integers:
	int a = 5;
	int b = 3;

and add them together:
	int c = a + b;

and print them out.:

Now do some simple string manipulations:
	String myName = "REMOVEDel";
	System.out.println("Hi, my name is " + myName  + " and my favorite number is: " + c);

Open up some of the premade java files that we gave you (in the java-source folder). Be sure to open up and Compile those two files using the compile button. (Warnings are fine)

Set your mediapath (you'll become familar with this). It stores a variable to always point to the folder that has your pictures. You'll need to use these in your assignments because your TA may have a different location so you can't hard code the path.

and make sure it worked by loading a picture:
	Picture p = new Picture(FileChooser.getMediaPath("swan.jpg"));;

Create your first class

In Dr. Java make a new file and save it as
Now create your first class and a main method:

public class HW0 {
	public static void main(String [] args){
		//This is my first comment
		System.out.println("My First Class !!!!");

You'll have no problem understanding the above code after you go through the class, but that is for later lessons.
Save the code and compile it using the Compile button.

Now run the code using the interactions pane:
	java HW0

You should get an output of My First Class !!!!

You're all setup! It hasn't all been tested, but the basic functionality has. Go ahead and continue to play around with your first class !

Ask Questions on HW0-Fall07 here.

Back to the top

Links to this Page