X 9950 Prog 1
X 9950 Prog 1
Use a standard deck of 52 cards, which contains 13 different values (numbered 1 through 13) and 4 different suits. The suits may be any theme you like (does not have to be hearts, spades, etc.). Make this a four player game, where three of the players are controlled by the computer, and one player is controlled by the user. After shuffling, deal all of the cards to the four players. Each player will get 13 cards. Notes: 1. Make a class named Card, as well as a class named Deck 2. Shuffle the cards by randomly swapping 5000 pairs of Cards 3. Store the players hands in arrays of type Card The Game: 1. Display the player's 13 cards, but do not show the 3 other hands 2. Have the player 'bid' how many tricks they think they will win 3. If bid is made, the player scores 10 points for each trick bid 4. The computer scores 10 points for each trick made 5. The player loses 10 points for each trick bid if the bid is not made 6. Each time a computer controlled player leads a card, randomly choose a suit and lead the highest card of that suit 7. Each time a computer controlled player has to follow suit, play the highest card if the computer could win the trick, lowest otherwise 8. If a computer controlled player has to 'throw off' due to not having the suit lead, throw the lowest card from the suit it has the most of 9. When any player reaches 150 points, the game ends Keep in mind the following:
Name your source files cards.h, cards.cpp, and main.cpp. With invalid data, your program should respond appropriately. Each function prototype should have a description, preconditions, and postconditions. Test your code when you think you are finished. Try to break it. After you are done trying to break it, I will then try.