Use only CardDeck.java to hold deck of cards, and Card.java to represent each card

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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

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 }
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education