PA5
9. A Recommended Process
This assignment is complicated enough that you are unlikely to complete it if you do not
use a good process. What follows is one such process - try to complete at least steps 1-7 during break.
Try to bring up the UML side by side with the specification. You will probably need to use both to fully understand the relationships between the classes and the parameters being passed and objects needing to be created.
- Stub-out all of the classes. In other words, create stubs for all of the classes that contain all of the public constants and all of the public methods with empty bodies, except for return statements where needed. (In the stubs, methods that return a String should probably return either "" or null, methods that return an int should probably return -1 or 0, and methods that return a boolean should return true or false.)
- Implement Keys class.
- Test the Keys class.
- Implement the Card class.
- Test the Card class.
- Implement the Hand class.
- Test the Hand class.
- Implement the valueOf(Card) method in the BaccaratCroupier class.
- Test the valueOf(Card) method in the BaccaratCroupier class.
- Implement the valueOf(Hand) method in the BaccaratCroupier class.
- Test the valueOf(Hand) method in the BaccaratCroupier class.
- Implement the isNatural() method in the BaccaratCroupier class.
- Test the isNatural() method in the BaccaratCroupier class.
- Write the mustHit() methods in the BaccaratCroupier class.
- Test the mustHit() methods in the BaccaratCroupier class.
- Write the outcomeOf() method in the BaccaratCroupier class.
- Test the outcomeOf() method in the BaccaratCroupier class.
- Write the constructor for the BaccaratCroupier class.
- Write the start() method in the BaccaratCroupier class.
- Implement the Casino class.
- Test the complete application.
Finally, on the previous assignments, many of you have waited until you had everything working before you worried about style. For an assignment of this size, that's a very bad idea. You will be much more produc ve if you run checkstyle on each class while you are working on it.
Results from working shoe(0) test run:
Initial Deal Player: 3 of Clubs,2 of Clubs (5) Banker: 3 of Diamonds,5 of Clubs (8) Winner Banker Play again? y Initial Deal Player: 4 of Clubs,5 of Diamonds (9) Banker: 10 of Clubs,10 of Diamonds (0) Winner Player Play again? y Initial Deal Player: 9 of Diamonds,2 of Diamonds (1) Banker: 9 of Spades,3 of Hearts (2) After Draw Player: 9 of Diamonds,2 of Diamonds,8 of Hearts (9) Banker: 9 of Spades,3 of Hearts,7 of Spades (9) Tie Play again? y Initial Deal Player: 8 of Diamonds,5 of Hearts (3) Banker: 7 of Hearts,Jack of Clubs (7) After Draw Player: 8 of Diamonds,5 of Hearts,Jack of Diamonds (3) Banker: 7 of Hearts,Jack of Clubs (7) Banker Play again? y Initial Deal Player: Ace of Diamonds,6 of Diamonds (7) Banker: King of Spades,7 of Hearts (7) After Draw Player: Ace of Diamonds,6 of Diamonds (7) Banker: King of Spades,7 of Hearts (7) Tie Play again? y Initial Deal Player: 3 of Spades,3 of Clubs (6) Banker: Ace of Clubs,4 of Hearts (5) After Draw Player: 3 of Spades,3 of Clubs (6) Banker: Ace of Clubs,4 of Hearts,4 of Spades (9) Banker Play again? y Initial Deal Player: 8 of Clubs,3 of Hearts (1) Banker: 4 of Diamonds,9 of Clubs (3) After Draw Player: 8 of Clubs,3 of Hearts,10 of Hearts (1) Banker: 4 of Diamonds,9 of Clubs,10 of Spades (3) Banker Play again? y Initial Deal Player: 4 of Clubs,2 of Diamonds (6) Banker: 10 of Spades,5 of Hearts (5) After Draw Player: 4 of Clubs,2 of Diamonds (6) Banker: 10 of Spades,5 of Hearts,King of Hearts (5) Player Play again? y Initial Deal Player: 5 of Diamonds,8 of Diamonds (3) Banker: King of Spades,10 of Hearts (0) After Draw Player: 5 of Diamonds,8 of Diamonds,9 of Hearts (2) Banker: King of Spades,10 of Hearts,Jack of Spades (0) Player