CSC 120

Week 11


Reading Assignment:

Read Section 5.13
Here are the codes we looked at:
Card.java Deck.java Hand.java PokerHand.java CardTest.java DeckTest.java DeckTest2.java HandTest.java PairTest.java

Programming Assignments:

0. Please finish the programming assignment I.

------------------------------------------------------------------------------

1. It is an important skill to learn how to use java documentation. Here is the link to the doc java.util.ArrayList class: ArrayList API Also, read Section 5.13 of your textbook for more info and examples.

--------------------------------------------------------------------------------

2. The probability of getting a pair in a five-card poker hand is 0.422569. Technically, a pair is a hand with two cards of one face value and three cards of different face values not matching the pair. Our isPair() is a little different than this definition of pair. Now, modify the PairTest.java to test 1000 poker hands to estimate the probability of getting a pair. Is your number close to the one above?

--------------------------------------------------------------------------------

2. Add the following capabilities to PokerHand.java: