Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Java Lab 17: Card Game – Part 2 
 
1. Correctly implement the hashCode method in Card.java. 
 
2. Correctly implement the hashCode method in Deck.java. 
 
3. Add a field to Hand.java to store all the cards in a hand. As Hand.java shows, 
we want the ability to add and remove cards from the hand. What should the type of the 
field be and why? 
 
4. Correctly implement all the methods in Hand.java. 
 
5. Compile all your code and run spa.graphics.SpaGui to play! 
 
Here are some brief playing instructions: 
 
Everyone is dealt 5 cards, no card less than a 6 is dealt out. Every player, moving 
clockwise, chooses a card to play. You must play a card in the same suit that was lead if 
you have one; otherwise, you can play any card. Once everyone has played a card, the 
highest card in the suit that was lead wins the trick. If you win a trick, you lead (play the 
first card) of the next trick. The player who wins the last trick (the 5th trick) of the round, 
wins the entire round. 
 
If you are dealt a 6 or a 7, you will be asked if you want to dry one of those cards. If you 
dry a 7 and you win the round (win the last trick) with that 7, you score 3 points total. If 
you dry a 6 and you win the round with that 6, you score 2 points. If you win the round 
with any other card, you score 1 point. 
 
In our version, the first player to reach 5 points wins the game.