tut06_2009 - EE3206/EE5805 Java Programming &...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
EE3206/EE5805 Java Programming & Application Tutorial 6 – Programming with UML Class Diagrams 1. The following class diagram shows the structural model of a simple card game system. Briefly describe their relationships based on your observation. 2. Given the class Card shown in Code 1, implement the method compareTo which should returns a negative integer, zero, or a positive integer as the object itself (a card instance that executes this method) less than, equal to, or greater than the specified object (a card instance of the input argument). (Hints: Cards are first compared by their suits. If two suits are same, then their numbers are compared.) 3. In the same package, create the other three classes, CardCollection , Deck and Hand according to the diagram. The CardCollection holds cards with an ArrayList which is a scalable array. If you do not know how to use ArrayList , you may use a fix-size array to hold the cards. In this case, write another constructor to initialize the size of the regular array (that means a user can
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/20/2010 for the course ELECTRONIC EE3206 taught by Professor Tingchiwang during the Spring '10 term at École Normale Supérieure.

Page1 / 4

tut06_2009 - EE3206/EE5805 Java Programming &...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online