Question: Instructions Write a program that uses an array of structs to represent a card deck, where the card values are represented by enumerated types for

 Instructions Write a program that uses an array of structs torepresent a card deck, where the card values are represented by enumerated

Instructions Write a program that uses an array of structs to represent a card deck, where the card values are represented by enumerated types for the suit and cardValue. Your program will use functions to create the card deck, print a single card, print the card deck, deal two cards, then determine which card is the winner. Requirements: Use the enumerated types and data structures defined below: enum suits (CLUBS, DIAMONDS, HEARTS, SPADES); enum cardValues TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACEl; 1. struct cards (suits suit; cardValues card; cards deck[52]; cards card1, card2; 2. Define and implement the following functions: void createDeck (cards[): void printDeck (cards[]): void printCard(cards); void deal (cards[], cards&); void winner (cards, cards); 3. Write a main program that calls the functions to a. Create the deck b. Print the deck c. Randomly deal card 1 (Hint: use the random function (see page 128) to randomly generate a number between 0 and 51 that represents the array location of the card) d. Print card 1 e. Randomly deal card 2 f. Print card 2 4. 5. 6. g. Print the winning card Output must be labelled and easy to read Program must be documented with Name, Date, Program name, and description Submit zipped file with project, .cpp file, and screenshots of program output. Sample Output CAUsers Nancy.thibeault documentslvisual studio 20121ProjectsICIS1202Topic8EnumTypes Debu... Pick a card The card deck Two of Clubs Three of Clubs Four of Clubs Five of Clubs Six of Clubs Seven of Clubs Eight of Clubs Nine of Clubs Ten of Clubs Jack of Clubs ueen of Clubs Instructions Write a program that uses an array of structs to represent a card deck, where the card values are represented by enumerated types for the suit and cardValue. Your program will use functions to create the card deck, print a single card, print the card deck, deal two cards, then determine which card is the winner. Requirements: Use the enumerated types and data structures defined below: enum suits (CLUBS, DIAMONDS, HEARTS, SPADES); enum cardValues TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACEl; 1. struct cards (suits suit; cardValues card; cards deck[52]; cards card1, card2; 2. Define and implement the following functions: void createDeck (cards[): void printDeck (cards[]): void printCard(cards); void deal (cards[], cards&); void winner (cards, cards); 3. Write a main program that calls the functions to a. Create the deck b. Print the deck c. Randomly deal card 1 (Hint: use the random function (see page 128) to randomly generate a number between 0 and 51 that represents the array location of the card) d. Print card 1 e. Randomly deal card 2 f. Print card 2 4. 5. 6. g. Print the winning card Output must be labelled and easy to read Program must be documented with Name, Date, Program name, and description Submit zipped file with project, .cpp file, and screenshots of program output. Sample Output CAUsers Nancy.thibeault documentslvisual studio 20121ProjectsICIS1202Topic8EnumTypes Debu... Pick a card The card deck Two of Clubs Three of Clubs Four of Clubs Five of Clubs Six of Clubs Seven of Clubs Eight of Clubs Nine of Clubs Ten of Clubs Jack of Clubs ueen of Clubs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!