LCCC Course CIS 210 - Java Programming

Poker Application

  1. Each student is to add to their Player class the following methods (each count as 5 points per correct method). Note: the pair() method should return true even if the player has a three-of-a-kind or a four-of-a-kind. In other words, each method is "independant" of the other methods.
    • private boolean royalFlush()
    • private boolean fourOfKind()
    • private boolean straightFlush()
    • private boolean straight()
    • private boolean flush()
    • private boolean fullHouse()
    • private boolean threeOfKind()
    • private boolean twoPair()
    • private boolean pair()
    • private boolean highCard()
  2. Each student is to add to their Player class the following method. The purpose of this method is to call the above methods in order to return the String that describes the "best" poker hand that the player possesses. It is to be used by the Poker game as described below.
    • public String getHandType()
  3. Each student is to create a copy of their TenCard game called Poker.java and make the following modifications:
    1. Keep the 10 buttons on the screen (5 in first row, 5 in second row) that do everything that the TenCard.java did (i.e. clicking on the button gets a new card from the deck & puts a new image on the button)
    2. One button called "Deal" which, when clicked, will
      1. deal 5 cards to each player.
      2. ask each player what type of hand they have (displaying the answer in a textfield below)
      3. take the 5 cards out of the players hand and display the cards on the screen (i.e. on the buttons)
    3. Three text fields:
      a) One textfield which shows Player1's hand type (i.e. "Player 1 has a three of kind");
      b) One textfield which shows Player2's hand type (i.e. "Player 2 has two pair");
      c) One textfield which shows which player had the better hand (i.e. "Player 1 wins"); [bonus]
    4. Comment each method correctly.
    5. Be prepared to show your instructor your working program.

www.lc.edu

Last Updated: January, 2011