be adding all the cards

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 19RQ
icon
Related questions
Question

public class PokerAnalysis implements PokerAnalyzer {

 

privateList<Card>cards;

privateint[]rankCounts;

privateint[]suitCounts;

 

/**

* The constructor has been partially implemented for you. cards is the

* ArrayList where you'll be adding all the cards you're given. In addition,

* there are two arrays. You don't necessarily need to use them, but using them

* will be extremely helpful.

* The rankCounts array is of the same length as the number of Ranks. At

* position i of the array, keep a count of the number of cards whose

* rank.ordinal() equals i. Repeat the same with Suits for suitCounts. For

* example, if your Cards are (Clubs 4, Clubs 10, Spades 2), your suitCounts

* array would be {2, 0, 0, 1}.

* @param cards

*            the list of cards to be added

*/

publicPokerAnalysis(List<Card>cards){

this.cards=newArrayList<Card>();

this.rankCounts=newint[Rank.values().length];

this.suitCounts=newint[Suit.values().length];

 

thrownewUnsupportedOperationException();

}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Matrix multiplication
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT