Question: In section 1 3 . 2 , these following 3 methods are not finished. Your task is to finish these 3 methods. Remember that you
In section these following methods are not finished. Your task is to finish these methods. Remember that you need to write a main method to test that these methods are working correctly.
One way to do that is to print out a deck of cards from the first card to the last
Then shuffle the deck of cards
Then print out the cards again. The second printout needs to be different from the first printout.
public void shuffle
for each index i
choose a random number between i and length
swap the ith card and the randomlychosen card
private static int randomIntint low, int high
return a random number between low and high,
including both
private void swapCardsint i int j
swap the ith and the jth cards in the array
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
