Tuesday February 28, Friday March 3. Work in pairs.
Download a card class and a game class from the google doc folder. Do not use the combination we used in class. Put them together in Eclipse.
Make any necessary changes to get it to work. Clearly document what changes you made (in a separate file; google doc ok).
Also make style changes as you see necessary. Again, explain what you changed and why.
What are the benefits and tradeoffs of working with multiple classes Java classes as a group?
We will start by looking at interfaces examples and the ideas behind a linked list. Then we will start with this starting code for linked list and write a couple of methods as a group.
Start with the work-in-progress code that we wrote in class.
Finish writing and testing linked list class. More specifically:
toString()
method that returns a string representation
of a linked list. For instance, if the linked list has elements 3, 5, 8
(in this order), the toString
should return the string
[3, 5, 8]
. After you have written the method, you should be able to put
your linked list into a System.out.println
and use this for
debugging of other methods.toString()
to work, use it to test add
.add
works, write and debug
get
. Don't forget to check for exceptions being thrown.remove
in the OurList
interface (note that the method is described from the user's standpoint; the way
you think about it as an implementor is different -- you don't think of elements in
terms of their indices).
Write tests for remove
in TestOurLinkedList
. Think of
different cases that you need to consider. Make sure that you can successfully use
add
and get
after removing some of the elements.
The quality of your testing will be
graded.remove
, one case at a time, and run tests after each
modification, even if you know that some tests are going to break.remove
is implemented, make sure that your list is tested well; add
tests as needed.
Also pay attention to the quality of your code: simplify, streamline, and rename your
code as needed. Rerun your tests after each change to make sure that nothing is broken.
Send me all your code (CC your group).