Question: Java help for poker hands Determine not only if the hand contains a pair but if it contains four of a kind, three of a

In this project, you will write a program that "deals" five random playing cards. Each card will have a sait (Spades, Clubs, Hearts, or Diamonds) and a value (2-10, Jack, Queen, King, or Ace). You will then display the five cards, then display whether there is a pair (two cards with the same value) as well as the highest card (with Ace being high). Again, you are just determining if any pairs exist and the highest card. Here are four sample runs of the program from the command line (Console 1/0 ): *"Notice in the last runt that the 5 of Diamonds was drantn nvice. This is OK for this propect. In this program, you will meed to generate random mambers to simulate "drawing" cards, Gencrating a random number was covered in lecture and in lab during Weck 2 and in your zyBook (Section 3.1). I/ Do this once at the top of the file import java.util."; /IDo this ence at the beginning of main Random r= new Random ): HDo this every time yeu want to draw a card intval=r.nextlnt(n);(willgeneratenandomnamberfromuptobutnotinchuden) Requirements / Tips: As with Project 1. Progemmumer defined abjects can NOT be used for this project. Use of additional methods IS allowed but global variables declared outside of any method are NOT allowed. You must properly pass . values between methods. Also, do NOT USF. PACKAGES in this course. Packages cause compiling /execution errors for GTAs when grading and they are not necessary for the projects assigned in this course. - To simplify grading, the output of your program must look EXACTLY like the sample run shown. This includes spacing, line feeds, spelling, capitalization, etc. - Assume several card decks are being used. As shown in the last run above, it's OK if you deal the same card multiple times (however, if your random numbers are working properly, it shoulda't happen often). - If the hand has multiple pairs, you only need to display one of them. - If there are no pairs, display "You have no pairs". - I might suggest generating a random number from 0 - 3 or 1.4 and wse those values to represent the 4 suits (Spades, Clubs, Hears, or Diamonds) and a random number from 2-14 to represent the card value (2-10, Jack, Queen, King, or Ace, where 11= Jack, 12 -Oween, efc.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
