Create a program that sorts a user\'s hand into ascending order, based upon the
ID: 3567901 • Letter: C
Question
Create a program that sorts a user's hand into ascending order, based upon the worth of each card in the hand. For this problem, you should ask your user to identify the cards in her hand, and then organize the cards for her in ascending order of worth. Note that, though the ace of any suit has the value "1," it should be considered the card with the highest worth. Cards should also be sorted so that clubs precede diamonds, diamonds precede hearts, and hearts precede spades.
Each card should be stored in a structure that can store the card's suit and the card's value. Each card has a suit and a value. The suit is represented as a character ('h' for hearts, 'd' for diamonds, 's' for spades, 'c' for clubs), and a value (2 - 10, plus 11 for jacks, 12 for queens, 13 for kings, and 1 for aces. ) All five structures are stored in, sorted in, and output from a single array.
Consider the following hand:
card 1: 8 of clubs
card 2: 2 of diamonds
card 3: Ace of spades
card 4: 8 of spades
card 5: Ace of clubs
The hand sorted into ascending order would be output as:
2 of diamonds
8 of clubs
8 of spades
Ace of clubs
Ace of spades
Output the hand.
Your program should use the following functions:
- a function to fill an array with the values of the user's cards
- a function to sort the hand into ascending order, based on card worth
- a function to output the sorted hand