Computers and Technology

Java question please answer the coding question below which is number (2)PokerHandEvaluator. java. the attached picture below that is the same question. that picture is not clear that is why i updated it by sending you screen shot. just do the number 2 below. thanks
the class is PokerHandEvaluator
public class PokerHandEvaluator {
2) PokerHandEvaluator. java
This class consists of several static methods that you will write. The prototypes for the methods are:
public static boolean hasPair(Card[] cards)
public static boolean hasTwoPair(Card[] cards)
public static boolean hasThreeOfAKind(Card[] cards)
public static boolean hasStraight(Card[] cards)
public static boolean hasFlush(Card[] cards)
public static boolean hasFullHouse(Card[] cards)
public static boolean hasFourOfAKind(Card[] cards)
public static boolean hasStraightFlush(Card[] cards)
The parameter for each of these methods will be an array of exactly 5 cards. Each method will return true or false, based on whether or not the given set of cards satisfies the poker hand being evaluated in the method. For example, the hasTwoPair method will return true if the set of cards has two pairs of different values (e. g. a pair of 4's and a pair of Jacks). If you need to review the various "poker hands" being tested in the methods, please take another look at the Poker Hand Page.
Important: Each of these methods checks whether or not the set of cards satisfies the given poker hand, but it does not care if it could also satisfy a better hand. For example, if the current hand is
then the results of calling each method should be as indicated below:
hasPair -- true (there is at least one pair)
hasTwoPair -- true (there are two pairs of distinct values)
hasThreeOfAKind -- true (there are three Aces)
hasStraight -- false
hasFlush -- false
hasFullHouse -- true (there are three Aces and two Jacks -- that makes a "full house")
hasFourOfAKind -- false
hasStraightFlush -- false
Important: In order for a hand to qualify as "Two Pair", it must have two pairs of distinct values -- in particular, having four-of-a-kind does not also count as two pair. For example, if the current hand is
<2 of diamonds, 2 of spades, 2 of hearts, 2 of clubs, 9 of spades>
then the results of calling each method should be as indicated below:
hasPair -- true (there is at least one pair)
hasTwoPair -- false (there are not two pairs of distinct values)
hasThreeOfAKind -- true (there are three 2's)
hasStraight -- false
hasFlush -- false
hasFullHouse -- false
hasFourOfAKind -- true (there are four 2's)
hasStraightFlush -- false
JUnit Tests
You are required to submit JUnit tests for all of the methods in the PokerHandEvaluator class. Your tests should be as thorough as possible! Be sure that for each method you have written some tests where the method returns "true", and some tests where the method returns "false".
10% of your grade on this project will be determined by the thoroughness of the tests you write. (Note: To get any credit at all for your JUnit tests, your project must pass all of the tests you have written!) Put your tests into the file provided called "StudentTests. java". If the tests are not located in this file, you will not get credit for them.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:00, eila3601
As with any small island country, cuba has fewer natural resources than countries such as brazil. this affects their economy in that cuba a) exports only manufactured products. b) exports more products than it imports.. c) must import more products than it exports. d) has imposed trade barriers against the united states.
Answers: 3
image
Computers and Technology, 23.06.2019 13:00, dimondqueen511
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
image
Computers and Technology, 24.06.2019 07:00, jordaaan101
Guys do you know sh27 cause he hacked me : ( pidgegunderson my old user
Answers: 2
image
Computers and Technology, 24.06.2019 12:00, elainnysanchez1541
How can we take picture in this app
Answers: 1
Do you know the correct answer?
Java question please answer the coding question below which is number (2)PokerHandEvaluator. java....

Questions in other subjects:

Konu
Mathematics, 17.11.2020 01:00
Konu
History, 17.11.2020 01:00
Konu
Geography, 17.11.2020 01:00
Konu
Mathematics, 17.11.2020 01:00
Konu
Spanish, 17.11.2020 01:00