Shuffling:
Suppose you are developing the Card Game program suggested by Figure in the text. The following partial UML class diagram shows where you are in the developmental process:

Assume that you have written methods for a
Cardclass and a
GroupOfCardsclass. Also, assume that the
addCardmethod increments
currentSizeafter adding the input card to the end of the currently filled part of the
cardsarray. Finally, assume that the
removeCardmethod retrieves a reference to the card at
indexin the
cardsarray, decrements the
currentSizeof the cards array, shifts all array elements above
indexdown by one place, and returns the reference to the card originally at
index.
To shuffle the deck, use a
forloop that starts with
unshuffled = getCurrentSize()and steps down to one. In each iteration, use
Math.randomto pick an index in the unshuffled range, remove the card at that index, and then add it to the high end of the array. Include all that functionality in a
Deck.shufflemethod.
Extra credit:
Write Java code that tests your
shufflemethod. To do that, you’ll need to implement all of the classes and methods in the above UML class diagram. Your
mainmethod should instantiate a
deck,display it, shuffle it, and display it again.
Figure Preliminary class diagram for a Card Game program

We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.