MATLAB QUESTION
The objective of this assignment is to create a program that will
determine the probability that you will be dealt two aces (in texas
holdem) in a deck of 52 cards. In other words, suits don't matter.
You must create a function m file that runs a specified number of
hands and returns the percent of hands that the player is dealt 2
aces. It should be "function PerTwoAces = ProbTwoAces(Nhands)".
function PerTwoAces = ProbTwoAces(Nhands)
% Matlab function ProbTwoAces.m : Function to calculate the
probability
% of dealing two aces (in texas holdem) in a deck of 52
cards.
% create the deck of 52 cards, where contains 4 suits,
% each suit contains cards from 'Ace(1)' to 'King(13)'
% Here we represent Ace as 1, 2-10, Jack as 11, Queen as 12, King
as 13
numTwoAces = 0; % count of two aces dealt in a hand
for i=1:Nhands
% create a new deck every time a new hand is dealt
deck = [(1:1:13),(1:1:13),(1:1:13),(1:1:13)];
count = 0; %count of aces present in the hand
% a hand consists of 5 cards, so deal a card 5 times
for j=1:5
% randomly deal a card from deck
ind = randi(length(deck),1,1);
% check if the card is an Ace, increment the count
if deck(ind) == 1
count = count + 1;
end
% remove the card from the deck
deck(ind) = [];
end
% if number of aces dealt >=2, then increment numTwoAces
if(count >= 2)
numTwoAces = numTwoAces + 1;
end
end
% if number of hands to be dealt > 0
if(Nhands > 0)
PerTwoAces = numTwoAces/Nhands;
else
PerTwoAces = 0;
end
end
%end of function
Output:

MATLAB QUESTION The objective of this assignment is to create a program that will determine the...
discrete structure
Recall that a standard deck of 52 cards has 4 suits (hearts, diamonds, spades, and clubs), each of which has 13 ranks: 2-10, Jack, Queen, King, and Ace (in order from lowest to highest). Order of cards in a hand does not matter (a) (10 points) A full house is 3 cards of one rank and 2 of another rank. How many full houses are there in a 5-card hand if either the pair or the 3 of...
Please to indent and follow structure!!!!!
Assignment 3 - The card game: War Due Date: June 9th, 2018 @
23:55
Percentage overall grade: 5% Penalties: No late assignments
allowed
Maximum Marks: 10
Pedagogical Goal: Refresher of Python and hands-on experience
with algorithm coding, input validation, exceptions, file reading,
Queues, and data structures with encapsulation.
The card game War is a card game that is played with a deck of
52 cards. The goal is to be the first player to...
Using C++ Create a Blackjack program with the following features: Single player game against the dealer. Numbered cards count as the number they represent (example: 2 of any suit counts as 2) except the Aces which can count as either 1 or 11, at the discretion of the player holding the card. Face cards count as 10. Player starts with $500. Player places bet before being dealt a card in a new game. New game: Deal 2 cards to each...
C++ Purpose: To practice arrays of records, and stepwise program development. 1. Define a record data type for a single playing card. A playing card has a suit ('H','D','S',or 'C'), and a value (1 through 13). Your record data type should have two fields: a suit field of type char, and a value field of type int. 2. In main(), declare an array with space for 52 records, representing a deck of playing cards. 3. Define a function called initialize()...
plz type it for me
2. Write a program to play a very modified version of spades. The program will select two hands of 5 cards for a single player and the computer dealer. The hands should be chosen using a function and the random methods we discussed in class. Your function should check the cards to be sure that they have not been used in the other hand. If so, then another card will be chosen at random until...
For this assignment you will create a one-player variation of the game BlackJack. The game will be divided into five rounds. The goal of each round is to accumulate a hand of cards that gets as close to 21 without going over. At the beginng of the game you will start with a score of 100 points. After each round, the difference between your hand and 21 will be subtracted from your total score. The object of the entire game...
2. Let us construct a 36-card deck by removing all the hearts and kings out of a standard 52-card deck. That is, we have 12 face cards (1 through 10 plus jack and queen) for each of the three remaining suits, ^, ◇, and鸁Next, deal out a total of five cards. Since players sort their hands. order doesn't m atter. (a) (9 pts) What is the probability Pth of being dealt full house (3-of-a-kind +pair)? FH (b) (10 pts) Write...
Create a simplified Blackjack game using the Deck and Card classes (download the attached files to start). There is also a "TestCard" class that creates a Deck and runs some simple code. You may choose to use this file to help you get started with your game program. 1) Deal 2 cards to the "player" and 2 cards to the "dealer". Print both the player's cards, print one of the dealer's cards. Print the total value of the player's hand. 2) Ask...
NEED HELP TO CREATE A BLACKJACK GAME WITH THE UML DIAGRAM AND PROBLEM SOLVING TO GET CODE TO RUN!! THANKS Extend the DeckofCards and the Card class in the book to implement a card game application such as BlackJack, Texas poker or others. Your game should support multiple players (up to 5 for BlackJack). You must build your game based on the Cards and DeckofCards class from the book. You need to implement the logic of the game. You can...
C++ program
This program involves writing a VERY simplified version of the card game War. You may know this game or not but my rules are these 1. Split the deck between player1 and player2. Only the face values matter (2-14) and not the suits 2. Each player puts a card down on the table. The higher face value wins that hand. If the card values match, you will simply indicate tie and neither player wins.The original rules would require...