Implement PokerValue as specified in textbook page 417, problem 33(a).
Your implementation must include following:
1. At least one ADT type selected from textbook files such as Stack, Queue, Collection and List for storing the poker hand.
2. Use only CardDeck.java to hold deck of cards, and Card.java to represent each card. GUI is not required.
3. Default constructor to create a five-card poker hand from CardDeck.java. Make sure the poker hand is implemented with one of the textbook ADT as set forth above.
4. Overloaded constructor accepts an array of five cards to initialize one poker hand.
5. toString() method outputs in the same format as shown in SampleActualOutput.txt
6. You may add other methods as necessary.
7. Test your PokerValue.java with supplied PokerGame.java.
Submit PokerValue.java
Transcribed Image Text:1 package FinalExam.Question2;
2
3 // Implement PokerValue as specified in textbook page 417, problem 33(a).
4 // Your implementation must include following:
5 // 1. At least one ADT type selected from textbook files such as Stack, Queue, Collection and List for storing the poker hand.
6 // 2. Use only CardDeck.java to hold deck of cards, and Card.java to represent each card. GUI is not required.
7 // 3. Default constructor to create a five-card poker hand from CardDeck.java. Make sure the poker hand is implemented with one of the textbook ADT as set forth above.
8 // 4. Overloaded constructor accepts an array of five cards to initialize one poker hand.
9 // 5. toString() method outputs in the same format as shown in SampleActualOutput.txt
10 // 6. You may add other methods as necessary.
11 // 7. Test your PokerValue.java with supplied PokerGame.java.
12
13 public class PokerValue {
14
protected ListInterface<Card> hand = new SortedABList<Card>(); // Sort by rank with default constructor
15
160
protected enum Hands {
17
Royal Flush, Straight Flush, Four_of_a_Kind, Full House, Flush, Straight, Three_of_Kind, Two_Pair, One_Pair,
High_Card
18
19
}
20
210
public PokerValue() {
22
}
23
240
public PokerValue (Card [] handArray) {
25
26
}
27
28
29
x300
public String toString() {
31
32
}
33
public Object[] toArray() {
Object[] result = new Object[6];
return result;
}
public static void main(String[] args) {
}
*********
42 }
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.