Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

angelina shreave

Greenhorn
+ Follow
since Jul 19, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by angelina shreave

Wow -- thank you so much for all your help and for taking the time to reply! My code works now
2 years ago
Hi all! Newbie programmer here

I'm trying to make a class that works with two other classes to take in a boolean array and an object of type Deck (detailed below). The ultimate idea is to replace a dealt ArrayList of 5 cards and to replace each card (if the corresponding boolean  value in the boolean array is true) with a card from a shuffled array (all while adding to an ArrayList as a discard pile), but I'm getting the following errors:



Here's my Card class:




Here's my Deck class:



And here's my FiveCardHand class (which is what I'm working on):





For context (especially with the boolean array) this is my ideal output :

Player's Hand: FIVE CARDS:
Card # 1: Nine of  Clubs
Card # 2: Four of  Hearts
Card # 3: Three of  Hearts
Card # 4: Five of  Spades
Card # 5: Ace of  Clubs


Would you like to replace card # 1 ? y
Would you like to replace card # 2 ? n
Would you like to replace card # 3 ? n
Would you like to replace card # 4 ? n
Would you like to replace card # 5 ? n

Replacing card at position(s) 1--> with Nine of Diamonds

Player's Hand: FIVE CARDS:
Card # 1: Nine of  Diamonds
Card # 2: Four of  Hearts
Card # 3: Three of  Hearts
Card # 4: Five of  Spades
Card # 5: Ace of  Clubs



Thank you -- sorry this was so long! Would really appreciate some help
2 years ago