Carnegie Mellon University Website Home Page
 
Spring 2018

15-121 Homework 1: Arrays and Objects - Due 1/29 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 recitation or via email to me. Do not change any method names!
  • 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 some rational manner. In addition, you are to create 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!).
  • Make sure that you include your name and andrewid in each file as well as the number of hours you worked on each part of this assignment.
  • BONUS POINTS - Props (and an indeterminate number of bonus points) for creative additions to the Person class. Points awarded at the discretion of the judge. 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 the assignment and tested your code thoroughly, create a .zip file with your work (including ArrayTester.java and Person.java). Name the zip file "your-andrew-id".zip and upload it to the HW1 folder on Box.

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