[ad_1]
This project is a simplified version of the casino card game Blackjack. The game works like this. Each player
tries to reach a total of 21 without exceeding that amount. Numbered cards count as their face value. An ace
counts as either one or 11 (whichever is best for the player) and any jack, queen, or king counts as 10.
The computer is the casino or house and it competes against one to seven players. At the beginnning of the
round, all participants, including the house, are dealt two cards. Players can see all of their cards, along with
their total. However, the house’s card’s are hidden for the time being.
Next, each player gets a chance to take additional one additional card at a time for the time being. If a player’s
total exceeds 21 (known as busting), the player loses. After all players have had a chance to take additional
cards, the house reveals its hidden cards. The house must take additional cards as long as its total is 16 or
less. If the house busts, all players who have not busted win. Otherwise, each remaining player’s total is
compared to the house’s total. If the player’s total is greater than the house’s, he wins. If the two totals are the
same, the player, ties the house (AKA pushing). You may have ties in this game.
You will need the following classes to design this program: Card, Hand, Deck, GenericPlayer, Player, House,
and Game. You will use only public inheritance. A Deck class inherits from a Hand class. A GenericPlayer
class is an abstract class. A Player class and a Hand class inherits from a GenericPlayer class.
The Deck class will create a deck of 52 cards, shuffle cards, deal cards to a hand, and give additional cards to
a player for as long as a player wants to hit. A card class will indicate wheter the card is face up, return the
card value and flip a card. The Hand class adds cards to the hand and returns the total value of the hand.
Have a betting scheme. The house only shows the first card. Let each player start with a certain amount of
money $500. They can bet up to $100 each round and they must bet in $100 increments.
Following is an example input/output:
Welcome to Blackjack!
How many players (1-7)? 3
Enter player name: Jessica
Enter player name: Joshua
Enter player name: Jackie
Jessica AD JC (11 or 20)
Joshua 6C KH (16)
Jackie 7H 4S (11)
House xx xx
Jessica do you want to hit (Y or N)? N
Joshua do you want a hit (Y or N)? Y
Joshua 6C KH 7S (23)
Joshua busts.
Jackie do you want a hit (Y or N)? Y
Jackie 7H 4S 3C (14)
Jackie do you want a hit (Yor N)? Y
Jackie 7H 4S 3C JD (24)
Jackie busts.
House: 7H 3S (10)
Jessica wins.
Do you want to play again (Y or N)? Y
Play the game using 2 players. Is the winner correct? Are the cards random? Play the game again using 2
players. Is the winner correct? Are the cards random?
Sample Solution
The post C++ Blackjack appeared first on acestar tutors.
[ad_2]
Source link