Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below I have a Constructor that creates a deck of cards: public Deck2(){ cardDeck = new Card2[numCards]; for(r=2;r <15;r++) { for(s = 1;s <5;s++) {

Below I have a Constructor that creates a deck of cards:

public Deck2(){ cardDeck = new Card2[numCards]; for(r=2;r<15;r++) { for(s = 1;s<5;s++) { int x = (r-3)+s; cardDeck[x]= new Card2(r,s); } } }

But i get this Output:

[2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A, A, A, A, null, null, null, null, null, null,..]

any way i can modify the constructor to print all the cards

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

How often are budgets adjusted?

Answered: 1 week ago