deck of cards java

Mugiwara

Active member
Legendary
Joined
Apr 25, 2008
Messages
11,625
Kin
24💸
Kumi
0💴
Trait Points
0⚔️
Awards
Need help creating a java program.
Just created a class called "Card" which had the following methods:
getSuit, getValue, toString(returns a text with the suit and value), constructor.

Need to create a class called "Deck of Cards" with the following:
Constructor without parameters, that creates an empty deck.
fillCardDeck: creates the 52 cards (no jokers), and puts them in the deck.
shuffle: shuffles the cards, placing them randomly inside the deck.
pick: picks the card that is on top, removing it from the deck and returns to us which card it is.
addCard(Card): Adds a card on top of the deck.
topCard: returns which card that is on top of the deck, without removing it from the deck.
amountCards: returns how many cards there are in the deck.
isEmpty: returns true if the deck is empty, false if not.
removeCard(int): removes the card in the stated position in the deck.

(returns means: return getSuit; for example)
addCard(Card) using the Card class I created (I believe thats what the assignment means).
 
Top