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 13.2, these following 3 methods are not finished. Your task is to finish these 3 methods. Remember that you need to write a main method to test that these 3 methods are working correctly.
One way to do that is to print out a deck of 52 cards from the first card to the last
Then shuffle the deck of 52 cards
Then print out the 52 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 -1
// swap the ith card and the randomly-chosen card
}
}
private static int randomInt(int low, int high){
// return a random number between low and high,
// including both
}
private void swapCards(int 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 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!