Discount Get COMP 220 ALL WEEKS Solution ONLY $92.95 $123.93
COMP 220 Week 1 - Blackjack Program C++ [$19.99]
COMP 220 Week 2 - Resistor Program C++ [$15.99]
COMP 220 Week 3 - Bank Account Program C++ [$19.99]
COMP 220 Week 4 - Filter Program C++ [$19.99]
COMP 220 Week 5 - Pointers and Pointer Operations C++ [$15.99]
COMP 220 Week 6 - Filter Program C++ [$15.99]
COMP 220 Week 7 - Polymorphism C++ [$15.99]
Get Selected Weeks Solution with ONLY NOT Add Selected Tutorials To Cart
COMP220 COMP 220 COMP/220 Week 1 - Lab 1 - iLab 1 - Blackjack Program C++
    COMP220 COMP 220 COMP/220 Week 1 - Lab 1 - iLab 1 - Blackjack Program C++

COMP220 COMP 220 COMP/220 Week 1 - Lab 1 - iLab 1 - Blackjack Program C++

$19.99

Enter the following source, which will set up the 2D array and the recommended variable declarations. It is up to the student to design and implement the remainder of the program code.

// Programmer:  (put your name here)

// Course:  COMP220

// Assignment:  Two-Dimensional Arrays

// Description:  The program will use a 2D array and a random-number 
// generation to play Blackjack and keep track of a playing-card deck.

// Input:  User data entry and a playing-card deck represented as a two-
// dimensional array

// Output:  A screen display showing the current card hands of each player
// and the dealer, their score, win and lose status, and a final representation
// of the card deck after the game is over

#include 
#include 
#include

using namespace std;

void main (void)

{
bool bPlayerDraw[5];    //Boolean to determine if player holds (F)

//or draws card (T)

char cPlay = 'N';       //Character variable for play game input
char cCardDeck[4][13];  //Character array representing the card deck
int iCard;              //Card array index
//0 = 2 card                                                              
//1 = 3 card
//2 = 4 card
//3 = 5 card
//4 = 6 card
//5 = 7 card                                                           
//6 = 8 card                                                         
//7 = 9 card                                     
//8 = 10 card                                                       
//9 = jack card
//10 = queen card
//11 = king card
//12 = ace card
int iNumberOfDraws = 0; //Number of rounds of card draws
int iSuit;                             //Suit array index

 //0 = diamonds
//1 = hearts
//2 = clubs
//3 = spades

// ASCII character display reference for display card suit symbols
//3 = heart symbol
//4 = diamond symbol
//5 = club symbol
//6 = spade symbol

int iNumberOfPlayers = 0;//Number of players in current game
int iPlayerCount[5];      //Integer array to holder each player's count
                                   //iPlayer[0] is always the dealer
int iHighestCount = 0;  //Highest count for a single game
int k, m;                       //integer loop counters
srand(GetTickCount());  //Seed the random-number generator

 //Main game loop
//Enter your code here…

Here is a sample of the finished program’s output.

Welcome to Honest Sam's Blackjack Table

Glad to have you back!

Enter the number of players in the game.
There must be at least one player but no more than four.
Number of players:  3

                     Dealer   Player 1  Player 2  Player 3
Card 1:          5♣        7♠       4♥        Q♥
Card 2:          5♠        K♥       5♥        2♠
Card 3:          J♥        4♠        6♣       10♥
Card 4:        Hold      Hold      Q♣      Hold
Card 5:        Hold      Hold      Hold     Hold

Final:           20        21        25        22
Lose      Win!      Lose      Lose

Display entire card deck, rows = suits, columns = card

0 = dealer card, 1 = Player 1 card, 2 = Player 2 card, etc.

My tutorial contains Visual C++ 2010 Project.

If you have more questions, please contact me via email support@extutorials.com

I will help you any time

Thank you !

Attached Files

Move over [ preview ] file name to preview content in it!

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B