Question: write the code please. CS 251 Program 01 Main topics Programmer defined methods Random number generators Arrays Program Specification: You are to develop a program

write the code please.  write the code please. CS 251 Program 01 Main topics Programmer
defined methods Random number generators Arrays Program Specification: You are to develop

CS 251 Program 01 Main topics Programmer defined methods Random number generators Arrays Program Specification: You are to develop a program which emulates a full deck of playing cards. That in 4 suits (Clube, Spades, Hearts and Diamonds) and 13 rk (Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King) in each it. This of course makes for a total of 82 playing cards in the deck Mandatory methode public static void initDeck (boolean[deck) // set the values of deck to indicate that they are all // present - not dealt yet. public static boolean emptyDeck (boolean deck) // returns whether or not all the cards in the deck I have already been dealt. public static int deal Card(boolean I deck) // returns & card (an tot in the range 0 to 51) at randon // that has not been dealt since the deck was initialize // via intDeck. Also notes (in deck) that this card is // no longer available. public static void print Card (int card) W/ given a card (an int is the range 0 to 51) prints // an appropriate representation of this card based // on a 1-1 and onto mapping of the set to. 61] to // the cards described above. Rules and Requirements: Your main method most end with the following block of code, which can not be modified boolean myDeck - new boolean (62): final int cards PerRow - 8: int carde Thinlov - 0; int myCard: initDeck (ayDeck): System.out.println(" Here is a shuffled deck ... "); while (leptyDeck(myDeck)) { myCard - dealCard (myDeck): ++cardsThis low: if (cardsThishow cu cardoPerrow) { printCard (myCard); System.out.print(" "); } else { System.out.println(""); cardsThisRow - 1; printCard (myCard); System.out.print(" "); } } System.out.println(' '); Notes and Hint: 1. You should write and test your methods one at a time. Sample run(s): Here is a shuffled deck 7S KS 2H 6S 4C 2D 9D 9C 4H 7C9H 3D 5H 5D 10S 28 JH AH 4S KC QC AD QD 7D AS KD 5C 7H KH 3C JC 2C 4D 8H AC 5S 10C JS 3H 9S 8D 10D 8S 6C H 8C JD 3S QS 6D 10H 6H Here is a shuffled deck ... 2D 10C AD 6C JC JH KS 48 9C 98 28 AC QS 3C3H8C 3S QC AS 4D 10S 2C 8S 6D 6S 9H 2H 5S JD KD QH 10D 7H QD 3D 6H 7D 8H 5D 4H KH 8D 7C9D 7S 5C SH KCJS 4C 10H

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!