Question
I can't figure out why this code wont compile and work public class DeckOfCards { private Card[] deckOfCards; // Represents the deck //Variable Declaration private
I can't figure out why this code wont compile and work
public class DeckOfCards { private Card[] deckOfCards; // Represents the deck //Variable Declaration private int dealtCards; private int remainingCards;
// No-arg/Default constructor public DeckOfCards() { deckOfCards = new Card[52]; // 52 card deck dealtCards = 0; remainingCards = 42; int count =0; int i,j; // Nested for loops for (i=1;i<=4;i++) { for (j=1;j<=13;j++) { deckOfCards[count++] = new Card(i,j); } } } public void shuffle() { Random randNum = new Random(); deckOfCards = new Card[52]; int count =0; while (count<=51) { int suit = randNum.nextInt(4)+1; // 1 to 4 int face = randNum.nextInt(13)+1; // 1 to 13 boolean result = false; for (int i =0; i There are 3 Steps involved in it See step-by-step solutions with expert insights and AI powered tools for academic successStep by Step Solution
Step: 1
Get Instant Access to Expert-Tailored Solutions
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started