Carnegie Mellon University Website Home Page
 
Fall 2013

15-121 Homework 1: Arrays and Objects - Due 9/9 at midnight

Download and unzip hw1-code.zip, which contains the two files you will need for this assignment. There are two parts:

  • In the file, ArrayTester.java, you will find 10 method declarations with empty bodies. You are to implement each of these incomplete methods and write code that calls and tests them in the main method. Each method has a comment describing what it is supposed to do; questions about functionality should be discussed in Thursday's recitation or on the d-list.
  • In the file, Person.java, you are to extend the class that we wrote in lecture with at least two (2) new attributes (fields) and methods that display and utilize them. In addition, you are to create 5 Person instances to populate the contacts array and then display your contacts in an appropriate manner. I don't want to over-constrain this, but I also don't expect you to go wild (like by trying to implement a Facebook-like friends-of-friends graph; that will come later in the course!).
  • BONUS POINTS - Props (and an indeterminate number of bonus points) for creative additions to the Person class. Points awarded at the discretion of the judges. All judging decisions are final. YMMV.

Note: You will be graded in part on your coding style. Your code should be easy to read, well organized, and concise. You should avoid duplicate code.


Submitting Your Work

When you have completed this assignment and tested your code thoroughly, create a .zip file with your work (including ArrayTester.java and Person.java). Name the zip file "your-last-name".zip and email it to me mjs@cmu.edu.

Make sure to keep a copy of your work just in case something goes wrong!