Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please do this in java Stacks are really useful for things like playing cards. I

ID: 3834369 • Letter: P

Question

Please do this in java

Stacks are really useful for things like playing cards. In this program, I want you create a Stack of 52 different cards that you can shuffle and then “deal” out the players. You can read the cards in from a file, shuffle them and then deal them out. You are to ask the user how many players there are and then deal 5 cards to each of them. After you deal them, you should have each player display their cards.

The players should then be able to reshuffle and re-deal as many times as they want. This can be done graphically or in the console.

Explanation / Answer

import java.util.*; public class deck2 { ArrayList cards = new ArrayList(); String[] values = {"A","2","3","4","5","6","7","8","9","10","J","Q","K"}; String[] suit = {"Club", "Spade", "Diamond", "Heart"}; static boolean firstThread = true; public deck2(){ for (int i = 0; i