COMP 110-001 - Introduction to Programming (Spring 2009)

Program 2: BlobManager

50 points

Assigned: Monday, February 9th

Due: Wednesday, February 18th by midnight


Part 1: Download the files, Compile, and Run

On the course webpage, you will find Blob.java and BlobManager.java. Download both files into the COMP110 directory you use with jGRASP. Modify the Program Header in "BlobManager.java" to reflect your name and due date.

You can now compile and run "BlobManager.java". A window will then pop up with your very own pet blob named Roberto. At this point you can feed Roberto some pizza, shrink him back to his original size, or change his color. However, you will notice that a couple of the functions don't work entirely the way that they should. For example, feeding him only one slice gives him five pieces of pizza. If you change his color to purple, it becomes red instead! Also, even when he grows to be a decent sized fellow, his size is still listed as "Tiny".

Part 2: Modify the Code

Inside of "BlobManager.java", there are four methods that need code modifications to fix the problems above.
Add your code for each item between where you see the comments:

/* ************ MAKE CHANGES HERE ************ */

(your code goes here)

/* *************** END CHANGES *************** */

NOTE: You do not need to modify any code in "Blob.java", nor should you modify any code in "BlobManager.java" outside of the above comments. One exception is that you are welcome to rename your blob from "Roberto" in the main method of "BlobManager.java" (only if you would like).
Here is what a modified version would look like after feeding him 1000 pizza slices and changing his color to purple.

Submission

For this assignment you will need to create a Jar file that contains the source code for your program. Follow these instructions for creating a Jar file.
The Jar file you submit must be named yourlastname_pro2.jar, where yourlastname is your last name.

Submit yourlastname_pro2.jar via the UNC Blackboard System before the deadline.

Requirements & Grading

If your java file does not compile or is submitted/named improperly, your maximum score is 0.