Computers and Technology

Objective: Exercise step-wise refinement to produce an object-oriented way of sorting a hand of cards. 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. Description: Have the user enter a hand of cards from the console in random order. Write a program that does a sort on a collection of a custom object (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 <10< 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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 13:00, alexacarillo
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
image
Computers and Technology, 23.06.2019 14:00, uday50
Select the correct answer. a company is currently focusing on creating specific management goals for itself. which level of maturity is the company demonstrating under the sse_ccm framework? a. performed informally b. planned and tracked c. quantitatively controlled d. well-defined e. continuously improving
Answers: 2
image
Computers and Technology, 23.06.2019 20:40, bobby3350
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
image
Computers and Technology, 24.06.2019 05:30, MOONCHILDSUGA
If you combine two cells into one, what action are you performing? a.  adding a new row or column      b.  splitting the cells      c.  removing a new row or column      d.  merging the cells
Answers: 2
Do you know the correct answer?
Objective: Exercise step-wise refinement to produce an object-oriented way of sorting a hand of card...

Questions in other subjects:

Konu
Mathematics, 25.02.2021 01:00
Konu
Mathematics, 25.02.2021 01:00