top of page

Homework #8(include Name,CST250-nn HW8,&date)
1.Answer the even numbered CheckPoin t questions (19.22-38).
2. Answer the odd numbered end of chapter Review questions (multiple choice, 19.11-21).
3. Answer the odd Find the Errors questions (page 1234).
4. Write an app that simulates the start of a card game. You'll need 5 classes: Card : whose code is provided 100% in the starterApp
CardDealer: no attributes, main() creates a new CardPlayer() and Deck(), then calls a .shuffle() method located in D
ck, next deals 5 cards to the player (call .deal() located in the Deck and pass it's result to .getCard() located in CardPl
yer, finally call .showCards() located in CardPlayer.
CardPlayer: 1 attribute:private TreeSet<Card> hand ; 1 command in the constructor : hand=new TreeSet<Card>(ne
CardComparator<Card>()); and 2 other methods: getCard(Card c) and showCards() which displays all 5 cards inasc
nding order.
Deck: 1 attibute: an ArrayList named cards to hold the deck of all 52
cards, a constructor that creates the deck, then loads all 52 cards into it like this:
for (int suit = Card.CLUBS; suit <= Card.SPADES; suit++){
for (int face = Card.ACE; face <= Card.KING; face++)
cards.add(new Card(face,suit));
finally the constructor calls shuffle(); to shuffle the deck; the shuffle() method, which just calls Collections.shuffle()
nd passes in the deck; the deal() method, which if the deck 's not empty rettuns card s.remove(0); otherwise return n
CardComparator: this class is similar to the one shown on text p. 1198 but needs to handle cases where 2 cards are "t
ed" based on faceValue by comparing suits, e.g., Six of Clubs < Six of Spades (see the Cards class to understand wh
Name your app CST250Lab8xxCard Game where xx = your initials
Provide softcopy(as your 5 separate .java files).

(Solved)-Homework #8 (include Name, CST250-nn HW8, & date)

$50.00 Regular Price
$45.00Sale Price
    bottom of page