Question

Problem 1 Red Dog (Points: 100/100) We will be writing a program that lets you play the game Red Dog. A description of the game can be found here: https://en.wikipedia.org/wiki/Red dog_(card game). This is also sometimes termed an in-between Acey Deucey. Red Dog is a game that is played with a standard 52-card deck. Suits are not considered in the game, all that matters is the order of cards, which from high to low runs Ace to King. The way the game works is the following 1. A player starts out with a certain amount of money in the bank. 2. A player places a bet out of that bank. 3. Two car ds are turned up. There are three possibilities: a If the cards are separated from each other by one (i.e. 8 and 9, 10 and J), the hand is a push. The player does not lose or gain anything. b If the cards are equal(ie, both 4s, both Ks, etc.): Deal a third card. If the third card is the same as the other two, the players payout is 11-1 (i.e. they Otherwise, the hand is a push. Display a spread to the player. If the cards differ by two, the spread is 5 to 1. If the cards differ by three, Deal a third card. If the third card is between (and including) the other two, they win and are paid Otherwise, they lose their bet. win 11 times their wager) c Otherwise, the two cards differ by more than one. the spread is 4 to 1. If the cards differ by four, the spread is 2 to 1, otherwise the spread is 1 to 1 according to the spread (i.e. if the spread was 5 to 1, they win 5 times their wager) Hints A helpful tactic when coding this assignment will be to think of dealing cards as choosing a random number be- tween 0 and 51. If we wanted complete accuracy of course, then a card, once dealt, would be removed from the deck for future dealings. On this assignment, that is not required. So each deal can be simply be considered as a random selection between 0 and 51 There are 13 different cards in the deck (A, 2, 3, K). You can modulo this random number by 13 to translate to an actual card in the deck (i.e. 0-A, 1-2,2-3,... ,12-K). You can use the following header files to generate random numbers: #include <stdlib.h> #include <time.h> You will need to use two functions: srand (time (NULL) to generate a random seed and rand ) to generate a random number. To see an example of how to generate random numbers check the code rand_number.cpp in our eLearning class site

media%2Fd5d%2Fd5d3df94-6b07-451e-974a-3c

media%2Ffb1%2Ffb1b4317-6ce6-4e21-8f94-f3

"Red Dog" in C++

0 0
Add a comment Improve this question Transcribed image text
Answer #1

else il cardl-13) else il card2 13) else whilc(valid2) coutEnter your bet.**endl; cinbet lbel 5000) coulInvalid bel. Please

Add a comment
Know the answer?
Add Answer to:
"Red Dog" in C++ Problem 1 Red Dog (Points: 100/100) We will be writing a program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A deck of cards eshtains 52 cards, of which 4 are aces. You sare offered the...

    A deck of cards eshtains 52 cards, of which 4 are aces. You sare offered the following wager Draw one card at random from the deck. You win $10 if the card drawn is an ace. Otherwise you lose S1. If you played this game many times what is the mean outcome O a. About S0, or that on average, you break even since the random draw gives you a fair bet O b. About negative 50.15, or that on...

  • Using C++ Create a Blackjack program with the following features: Single player game against the dealer....

    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++ program This program involves writing a VERY simplified version of the card game War. You...

    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...

  • the card game Acey Deucey, which is also known by several other names. In general, the...

    the card game Acey Deucey, which is also known by several other names. In general, the game is played with three or more people that continue to gamble for a pot of money. The pot grows and shrinks depending on how much General description of the game ● Two cards are dealt face up to a player from a shuffled deck of cards. ○ If the face of each card is the same then the player adds $1 into the...

  • In the American version of the Game Roulette, a wheel has 18 black slots, 8 red...

    In the American version of the Game Roulette, a wheel has 18 black slots, 8 red slots and 2 green slots.  All slots are the same size.  In a carnival game, a person wagers $2 on the roll of two dice.  A person can wager on either red or black.  Green is reserved for the house. If a player wagers $5 on either red or black and that color comes up, they win $10 otherwise they lose their wager.  What is the expected value of...

  • Consider a play of the casino game `Quick Draw'. In this game, a player pays $11...

    Consider a play of the casino game `Quick Draw'. In this game, a player pays $11 to play. The player picks one card from a standard pack of 52 cards (i.e. there are four A’s and four K’s in a standard pack of 52 cards). If the player gets an Ace, they win $50 but loose the amount they paid to play (the profit is revenue minus cost); if the player selects a King, they win $30 but loose the...

  • Need a blackjack code for my assignment its due in 3 hours: it has to include...

    Need a blackjack code for my assignment its due in 3 hours: it has to include classes and object C++. Create a fully functioning Blackjack game in three separate phases. A text based version with no graphics, a text based object oriented version and lastly an object oriented 2D graphical version. Credits (money) is kept track of throughout the game by placing a number next to the player name. Everything shown to the user will be in plain text. No...

  • C++ Purpose: To practice arrays of records, and stepwise program development. 1. Define a record data...

    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()...

  • 4. [6 marks] Consider a play of the casino game 'Quick Draw'. In this game, the...

    4. [6 marks] Consider a play of the casino game 'Quick Draw'. In this game, the player pays $10 to play. He/she picks onē card from the standard deck of 52 cards (i.e. four A's, four K's, etc.). If the player selects an "A", he/she wins $50 (i.e. the profit is $40); if the player selects a "K", he/she wins $30 (i.e. the profit is $20). Otherwise, the player wins nothing and also loses the bet of $10. Let the...

  • Complete a program In C#: some code is included, you edit the areas that have not...

    Complete a program In C#: some code is included, you edit the areas that have not been filled. For your C# program you will complete code that plays the War card game. In this game, the deck of cards is evenly divided among two players. The players are not allowed to look at the cards in their hand. On each round of the game, both players lay down the top card from their hand. The player with the higher value...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT