---------File name- aDeck.h-----------
class aDeckOfCards
{
vector<string> brand =
{"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
vector<string> suit = {"S","H","D","C"};
srand (time(NULL));
string draw()
{
int brandIndex =
rand()%13;
int suitIndex = rand()%4;
string card =
brand[brandIndex]+'-'+suit[suitIndex];
return card;
}
void printCards(vector<int> hand)
{
for(int
i=0;i<hand.size();i++)
cout<<hand[i]<<",
";
cout<<endl;
}
};
------------End of file-----------------
-----------File name- aDeck.cpp-----------------------
#include <bits/stdc++.h>
#include <aDeck.h>
using namespace std;
int main() {
aDeckOfCards deck = new
aDeckOfCards();
int hands; // no of hands to be
played;
cin>>hands;
int noOfCardsToDraw;
cin>>noOfCardsToDraw;
while(hands--)
{
vector<string>
hand;
for(int
i=0;i<noOfCardsToDraw;i++)
{
string
card=deck.draw();
hand.push_back(card);
}
deck.printCards(hand);
}
return 0;
}
-----------------End of File-----------------
Create A Header file and A CPP File for this we want to simulate drawing cards...
Specifications: C++ each class should have a header file all files must create a console application in Visual Studio We want to design our die class (to be named aDie) such that we can have statements such as: aDie D; // To instantiate a Die object int rolled = D; // To get the value rolled by D rolled = D + D; // To get the value of the sum of 2 rolls of the die aDie d1, d2;...
We want to design our die class (to be named aDie) such that we can have statements such as: aDie D; // To instantiate a Die object int rolled = D; // To get the value rolled by D rolled = D + D; // To get the value of the sum of 2 rolls of the die aDie d1, d2; // to instantiate 2 dice rolled = d1 + d2; // To get the value of the sum of...
Give answer in typed format Question( 13.) If you are dealt two cards from a 52-card deck without replacement, find the probability of being dealt a card that is a. A Heart. b. A King or a Diamond. c. A Queen and a Diamond. d. A Face card and a Spade. e. A red King. f. A black card g. A numeric Spade or Club. h. A red card followed by a black card i. A red card followed by...
Play Your Cards Right Obtain a standard deck of 52 playing cards. Mix them well and count out 25 cards WITHOUT LOOKING AT THEM. Put aside the remaining cards. You are going to perform an experiment to estimate the probablity of drawing a club, a diamond, a heart, and a spade from your deck of 25 cards. A. Mix the 25 cards well Draw one card. Record its occurrence in the approprlate box. below B. Replace the card and shuffle...
One card is drawn from an ordinary deck of 52 cards. Find the probabilities of drawing the following cards. a. A 2 or 5 b. A red card or a 4 c. A 2 or a black 3 d. A diamond or a black card e. A face card or a spade
Write a Java program to simulate Blackjack. The program should be as basic as possible while following the rules below. Thanks a. There is one deck of cards b. Cards are drawn randomly using (Shuffle() method) c. The value of a hand is computed by adding the values of the cards in hand d. The value of a numeric card such as four is its numerical value e. The value of a face card is 10 f. Ace is either...
4 cards are randomly drawn from a standard deck of playing cards. What is the prob- ability that all their suits are different? Hint: There are 52 cards in a standard deck of playing cards. A card can have 4 different suits: diamond ( ♦ ), club ( ♣ ), heart ( ♥ ), or spades ( ♠ ). There are 13 cards of each suit. Cards are further labeled by their rank: numbers 1 to 10 and three face...
Describe a sample space for successively drawing and keeping 4 cards from a standard deck of 52 cards if we record the value and suit of each card. Find the probability of each of the following: a. Ace, King, Queen, Jack of spades in that order; b. Ace, King, Queen, Jack of spades in any order; c. Ace, King, Queen, Jack: any suit, any order; d. all 4 selected cards are red; e. the cards selected are 3 hearts and...
Suppose a standard deck of 52 playing cards is thoroughly shuffled and a single card is drawn. Suppose an ace has value 1, a jack has value 11, a queen has value 12, and a king has value 13. (a) Compute P(X = x) for every real number x, when X is the value of the card drawn. (b) Suppose that Y = 1, 2, 3, or 4 when a diamond, heart, club, or spade is drawn. Compute P(Y =...
Here is a table showing all 52 cards in a standard deck. Face cards Color Suit Ace Two Three Four Five Six Seven Eight Nine Ten Jack Queen King Red Hearts AV 2 3 4 5 6 7 8 9 10 J K Red Diamonds A 2 3 4 56 7 89 10J 0 K Black Spades | A. 2. 3. 4. 5. 6. 7. 8カ 94 10.Je Q. K. Suppose one card is drawn at random from a standard...