Question: It is C++ assignment. Please explain ur code too. Homework 3 - Game of Hearts Before writing any code, play a few games at playhearts

It is C++ assignment. Please explain ur code too.

It is C++ assignment. Please explain ur code too. Homework 3 -

Homework 3 - Game of Hearts Before writing any code, play a few games at playhearts online.com Write a program that plays the card game of Hearts classes as needed. Create a new Player class with these member variables: including sort and shuffle functions. Add members to your Card and Deck Card hand[13] - stores cards dealt to player boolean played[13) - playedlil is true if handli] has been played, otherwise false int points-total number of points player has accumulated so far String name - name of player Player has these member functions: void displayHand() - displays descriptions of cards in hand on console void addCard() - adds a card to hand during deal Card playCard(Suit lead, boolean leader) - returns the Card played - if leader is false, card must be in the lead suit Add constructors, get and set functions, and other members as needed. Keep your main program simple. Most of your logic should be in member functions of classe:s. See the following pages for sample display and rules of the game. Challenge (optional - 1 bonus point) When one player takes all 13 hearts and the queen of spades, instead of losing 26 points, that player scores zero and each opponent scores 26 points. This is called 'shooting the moon' Implement 'shooting the moon' in your program Challenge (optional - 1 bonus point) Make your program smart enough so that any one of the computer players beats the TA two out of three hands. You must follow two rules: You cannot 'rig' the deal. Shuffle and deal must be random. .Players cannot see each other's hands. Players are aware only of their own cards. Homework 3 - Game of Hearts Before writing any code, play a few games at playhearts online.com Write a program that plays the card game of Hearts classes as needed. Create a new Player class with these member variables: including sort and shuffle functions. Add members to your Card and Deck Card hand[13] - stores cards dealt to player boolean played[13) - playedlil is true if handli] has been played, otherwise false int points-total number of points player has accumulated so far String name - name of player Player has these member functions: void displayHand() - displays descriptions of cards in hand on console void addCard() - adds a card to hand during deal Card playCard(Suit lead, boolean leader) - returns the Card played - if leader is false, card must be in the lead suit Add constructors, get and set functions, and other members as needed. Keep your main program simple. Most of your logic should be in member functions of classe:s. See the following pages for sample display and rules of the game. Challenge (optional - 1 bonus point) When one player takes all 13 hearts and the queen of spades, instead of losing 26 points, that player scores zero and each opponent scores 26 points. This is called 'shooting the moon' Implement 'shooting the moon' in your program Challenge (optional - 1 bonus point) Make your program smart enough so that any one of the computer players beats the TA two out of three hands. You must follow two rules: You cannot 'rig' the deal. Shuffle and deal must be random. .Players cannot see each other's hands. Players are aware only of their own cards

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!