If you haven't used Eclipse in the past, I recommend doing some of the tutorials on the Eclipse website to familiarize yourself with the various features. Also, please read up on JUnit if you haven't done that yet.
Type up your answers to this part of the assignment and submit in a plain text or pdf file as hw4B on Blackboard. You should also submit a printout in class next week.
1) [10 pts] Object-Oriented Design: Suppose you want to write a program to play (a non-betting version of) the BlackJack card game. You can read about the full version of the game on Wikipedia (or a host of other sites). We would have a dealer, several players and no betting in this simplified version. What classes would you create in designing an object oriented solution? Where would inheritance and interfaces come in handy? What would the relationships between the classes be? Consider similar programs (card games and games in general) that you might want to write and try to create some generally useful classes, not just ones tailored to this particular problem. Give a very brief description of 5-10 classes and interfaces that would comprise your system, along with the relationships between them, similar to what we did with the Activity Log exercise in class on 2/11. You do not have to draw a UML diagram, but are certainly welcome to include one.
2) [10 pts] Write an algebraic specification for abstract data type Set. A Set is a (not necessarily ordered) collection of unique elements. Make your specification general enough to apply to sets of different base element types, similar to our Array and Bag ADT specifications. A Set.java interface has been provided for you as a starting point. However, you do not need to include the union, intersection or toString methods in your algebraic specification.
1) Write a JUnit test program for the Set.java interface we have defined. We will write implementations of this interface in the future, so our goal is to have a complete set of tests to use in evaluating the implementations we write. You won't be able to actually run your test program on anything at this point, and it won't compile since we don't have an implementation to test. However, not instantiating Set objects should be the only compiler errors! We will basically grade it as a plain text file. You do not have to submit a printout. Remember that every method in the interface must be tested for all types of conditions it is expected to handle, including empty sets.