Question: C++ Assignment: I need help with the 3rd question of this assignment and if anyone would like to do the 4th more than welcome to

C++ Assignment: I need help with the 3rd question of this assignment and if anyone would like to do the 4th more than welcome to but I mainly just need the 3rd one. I have the first and second parts done already also that I will list below the image. Please andThanks in advance to whoever helps me out!

C++ Assignment: I need help with the 3rd question of this assignmentand if anyone would like to do the 4th more than welcome

Code that i have completed already..............

#include #include #include #include using namespace std; string suits[4]={"Hearts", "Diamonds", "Spades", "Clubs"}; string faces[12]={"Ace", "2", "3", "4", "5", "6", "7", "8", "9", "Jack", "Queen", "King"}; class Card { public: int face,suit; Card(int face,int suit) { this->face=face; this->suit=suit; } string toString() { string nameSuit = suits[suit]; string nameFace = faces[face]; return nameFace+" of "+nameSuit; } }; class DeckOfCards { private: vector deck; int currentLocation, location; public: DeckOfCards() { for(int i=0;i0) { Card returnCard = deck[currentLocation]; returnCard.toString(); currentLocation--; } } bool moreCards() { int size = (int) deck.size(); if(size == 0) return false; else return true; } }; int main () { DeckOfCards deck; deck.shuffle(); deck.dealCard(); };

I'd greatly appreciate it if someone can atleast get number 3 going.

1. Card Class (25 points) Write a class to represent a single card in MATLAB/C++. The class must keep track of the face value of the card and its suite. You are free to choose your own representation scheme for each card 2. Deck of Cards (25 points) Write a class to represent a deck of 52 cards (no jokers in MATLAB/C++ using the Card Class of Problem 1. For the deck of cards class, you must implement the following methods Create/reset and a deck of cards. You can use an array of cards or a vector in C++/MATLAR to store the deck of cards. Shuffle a deck of cards. Draw a card without replacement after shuffling the deck of cards. This method should return a card class object, and the total number of cards should be decreased by 1 Print the current contents of the deck of cards. Print both the face value and the suite 3. Empirical Probability (25 points) Write a method that calculates the empirical probability, i.e. the probability via experiment, of getting a combination of cards. For input, ask the user in a single line for the face and suite of cards. For example, if the user enters AH 10D KS QS JC, the user wants to know the probability of getting the Ace of Hearts, the 10 of Diamonds, the King of Spades, the Queen of Spades, and the Jack of Clubs when drawing five cards. You can calculate the empirical probability by repeating the experiment 1000 times and count the number of times the first 5 cards drawn match the cards available divided by the total, i-e. 1000. This method will entail creating a deck of cards object, drawing the required number of cards after shuffling, determining a match occurred or not, and then resetting the deck of cards for each simulation. Order does not matter. 4. Menu (25 points) Write a menu that tests the Deck of Cards class and the Empirical Probability calculator. The menu should perform the following Create/reset a deck of cards to 52 total cards. Shuffle the deck of cards. Draw and display the suite and face of a drawn card without replacement

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!