Question: Please use basic MATLAB functions and processes to implement the following problems. Please read instructions carefully and include well detailed comments so that I can

Please use basic MATLAB functions and processes to implement the following problems. Please read instructions carefully and include well detailed comments so that I can follow all steps and understand the code. Thanks in advance.

Please use basic MATLAB functions and processes to implement the following problems.

Problems In this lab, we will use MATLAB to implement a deck of cards and answer some probability questions. 1. Card Class (25 points) Write a class to represent a single card in MATLAB. 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 using the Card Class of Problem 1. or 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 MATLAB 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. o Draw and display the suite and face of a drawn card without replacement Print the current contents of the deck Calculate the empirical probability for drawing a given set of cards Quit Problems In this lab, we will use MATLAB to implement a deck of cards and answer some probability questions. 1. Card Class (25 points) Write a class to represent a single card in MATLAB. 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 using the Card Class of Problem 1. or 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 MATLAB 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. o Draw and display the suite and face of a drawn card without replacement Print the current contents of the deck Calculate the empirical probability for drawing a given set of cards Quit

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!