Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question: ?Game Of Hearts (C++) I Have A 69% In My C++ Class And I Need This Program To Work To Get Any Credit For

Question:?Game Of Hearts (C++) I Have A 69% In My C++ Class And I Need This Program To Work To Get Any Credit For It So I Can Pass My

Homework 3 - Game of HeartsBefore writing any code, play a few games at playhearts-online.comWrite a program that plays the

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. Your program should build on your code for Deck of Cards Lab, Double or Nothing Lab, and Shuffle and Sort Lab. Add members to your Card and Deck classes as needed. Create a new Player class with these member variables: Card hand[13]-stores cards dealt to player int points - total number of points player has accumulated so far String name - name of player Player has these member methods: 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 methods of classes. See the following pages for sample display and rules of the game. Challenge (optional - 1 bonus point) Make your program smart enough so that any one of the computer players beats the TA in one game. 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managerial Accounting

Authors: Ray H. Garrison, Eric W. Noreen, Peter C. Brewer

13th Edition

978-0073379616, 73379611, 978-0697789938

More Books

Students also viewed these Accounting questions

Question

1. Identify and discuss different types of business analysis.

Answered: 1 week ago

Question

3 Define the time value of money.

Answered: 1 week ago