Question: Can someone help me with this, it needs to be done in C. I have attached screenshots. Located below is the code I have to

Can someone help me with this, it needs to be done in C. I have attached screenshots.

Located below is the code I have to modify, thank you!

/* Simulates shuffling a deck of cards using structures and typedef by initializing, shuffling, and displaying the card deck */ #include #include  //time function #include  //random number generator functions #include  #define MAX 9 #define MAX_CARDS 52 #define MAX_RANKS 13 #define MAX_SUITS 4 #define COLS 3 /umber of columns to display in output //structure definition struct card{ char *rank; char suit[MAX]; }; typedef struct card Card; //array of pointers to strings for ranks char *ranks[MAX_RANKS] = {"Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"}; //two-dimensional array of strings for suits char suits[MAX_SUITS][MAX] = {"Clubs", "Diamonds", "Hearts", "Spades"}; void initialize(Card []); void shuffle(Card []); void display(const Card[]); int main(){ char newline = ' '; //to repeat while loop //declare an array of 52 cards Card deck[MAX_CARDS] = {"",""}; initialize(deck); printf("Display an ordered deck of cards: "); display(deck); while(' ' == newline){ printf(" shuffling deck ... "); shuffle(deck); display(deck); printf("Would you like to shuffle again? If so, press \"Enter\" key. If not, press any other key. "); newline = getchar(); } return 0; } /* initialize the deck of cards to string values deck: an array of structure cards */ void initialize(Card deck[]){ int i = 0; for(i=0;i 

Can someone help me with this, it needs to be done inC. I have attached screenshots. Located below is the code I haveto modify, thank you! /* Simulates shuffling a deck of cards usingstructures and typedef by initializing, shuffling, and displaying the card deck */

I. Edit, compile, and run the following program on the UH UNIX shell: A. T he purpose of this assignment is to learn how to use an array of structures. B. Modify the "struct card" structure and corresponding code in the card shuffling program cards.c to display the colors of the cards (red or black) C. Use an array of struct card in your program. The color will be a part of struct card. Don't use the color as a separate array D. //structure definition struct card char *rank; char suit[MAX]i //**add the color of the cards here ** typedef struct card Card E. Email your makefile and C program to the instructor, or show it to the instructor in class. II. For the submission guidelines and the grading guidelines, see the syllabus. Example l/O Display an ordered deck of cards: Ace of Clubs (black) Two of Clubs (black) Three of Clubs (black) Four of Clubs (black) Five of Clubs (black) Six of Clubs (black) Seven of Clubs (black) Eight of Clubs (black) Nine of Clubs (black) Ten of Clubs (black) Jack of Clubs (black) Queen of Clubs (black) King of Clubs (black) Ace of Diamonds (red) Two of Diamonds (red)

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!