subject

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.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:30, sayedaly2096
What type of file does a cookie place on web site visitors' computers so that web site managers can customize their sites to their visitors' preferences?
Answers: 1
image
Computers and Technology, 22.06.2019 21:30, elsauceomotho
Im doing this last minute and literally none of my neighbors or people that my dad works with use excel so if anyone could me make up an example
Answers: 1
image
Computers and Technology, 23.06.2019 03:30, 890777
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
image
Computers and Technology, 24.06.2019 00:50, JakeCline
Which of the following is not a key player in the sale of travel products?
Answers: 2
You know the right answer?
Java question please answer the coding question below which is number (2)PokerHandEvaluator. java....

Questions in other subjects:

Konu
Mathematics, 27.04.2021 22:20
Konu
Chemistry, 27.04.2021 22:20