Assignment by Nick Parlante
For this first homework, you will run through a series of small coding problems to get warmed up with Java
code, Collection classes, unit tests, and some basic OOP design. Get in the habit of pulling up the javadoc
pages for String, Collection, .
.. leveraging the built-in libraries. Download the hw1CodeCamp.zip file from
the course page. That contains a hw1CodeCamp directory that is an Eclipse project -- import it into Eclipse
to get started. This homework is due at midnight at the end of Wednesday January 13. Part A is made of
several small Java problems with strings, arrays, lists, and maps, all with unit tests. Part B is a short OOP
For part A, you have a variety of small coding problems to solve, each with unit tests. You should fill out
the set of unit tests for each problem until you are confident that your solution is correct. The deliverable is
that there are 5 or more assertEquals() or other assertions for each public method in part A. The starter code
has some tests filled in for some of the problems to get you started, and you should add more tests. Part of
this assignment is about experimenting with unit tests to really nail down the correctness of your code
beyond the usual "it appears to work" level. Since the problems are only moderately hard, have well-defined
input/output interfaces, and you can write unit tests, it is a reasonable goal that you will turn in literally
perfect code for all the problems -- zero bugs. Producing a body of zero bug code does not happen by
accident. It requires some organized effort at testing.
Part B centers on designing and writing a Shape class from scratch. For part B, the point is thinking about
the OOP design of the Shape class.
Our grading for Part A will be pretty simple -- we just have automated tests for each problem that verify that
your solution works correctly for a variety of inputs. The grading in that case will mostly just be about
correctness. That said you should still try to write clean code and use decomposition. For Part B, we just
want to see a reasonable effort at the OOP design.
CS108 homework ground rules: the starter code will often include some boilerplate such as the prototypes
for methods you need to write. A starter method may include a throwaway line like "return 0;" just so it
compiles when you first load the project. Your code can assume that all inputs are formatted and structured
correctly. Your solution should work correctly when presented with valid inputs, and we will not worry
about invalid inputs (yet). If your code takes in a parameter such as a String or a List, you may assume that
the String or List passed in is not null, unless null is specifically mentioned in the specification. In other
words, null is not a valid String or List. The empty string and empty list are valid of course, but in Java
those are different from null. Your code should never change the public interfaces given for homework