CS 149: Programming Fundamentals
James Madison University, Fall 2017 Semester

Baccarat logo

PA 5 specification  

PA5 UML

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.

  1. 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.)
  2. Implement Keys class.
  3. Test the Keys class.
  4. Implement the Card class.
  5. Test the Card class.
  6. Implement the Hand class.
  7. Test the Hand class.
  8. Implement the valueOf(Card) method in the BaccaratCroupier class.
  9. Test the valueOf(Card) method in the BaccaratCroupier class.
  10. Implement the valueOf(Hand) method in the BaccaratCroupier class.
  11. Test the valueOf(Hand) method in the BaccaratCroupier class.
  12. Implement the isNatural() method in the BaccaratCroupier class.
  13. Test the isNatural() method in the BaccaratCroupier class.
  14. Write the mustHit() methods in the BaccaratCroupier class.
  15. Test the mustHit() methods in the BaccaratCroupier class.
  16. Write the outcomeOf() method in the BaccaratCroupier class.
  17. Test the outcomeOf() method in the BaccaratCroupier class.
  18. Write the constructor for the BaccaratCroupier class.
  19. Write the start() method in the BaccaratCroupier class.
  20. Implement the Casino class.
  21. 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

Back to Top