Question: Computer ScienceWrite the code in C#Objective:Description: Exercise step-wise refinement to produce an object-oriented way of sorting. This will make use of the object oriented-concept of
Computer ScienceWrite the code in C#Objective:Description:
Exercise step-wise refinement to produce an object-oriented way of sorting. This will make use of the object oriented-concept of an interface. It should also exercise understanding of an ArrayList. Use good coding habits to avoid hard-coding values, avoid user input errors and bullet-proof your code.
Have the user enter a hand of cards from the console in random order. Write-a program that does a custom sort (not using a library in C#) to order the cards. Then print to the console a least-to-greatest ordered arrangement of the cards. Playing cards are ordered by value then by suit. The program should take any number of cards, so this could be a hand of five, seven or thirteen cards.
For values, assume: 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < J < Q < K < A For suits, assume: Hearts < Diamonds < Clubs < Spades
For simplicity of input this will only deal with capital letters, so if the user enters a lowercase letter, you should capitalize it.
Example:If a user enters 7H (it means 7 of hearts), 3C (it means 3 of Clubs), AH (it means ace of hearts), and AS (ace of spades), then it should print 3C, 7H, AH, and AS.
Bonus:
+ 30 Implement a method to shuffle the cards that the user provided.It should return a random ordering that will be different each time it is called.Call this after ordering the deck and output it again.
+10 Modify the input and output of the cards to be pretty so that it writes and accepts 7 of hearts instead of 7H
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
