subject

The ranks are: 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace. The suits are: Clubs, Diamonds, Hearts, Spades. For this question, we represent each rank by a string of length one:
’2’ to ’9’ for 2 to 9 respectively, ’T’ for 10,
’J’ for Jack, ’Q’ for Queen, ’K’ for King, ’A’ for Ace.
We also represent each suit by a string of length one:
’C’ for Clubs, ’D’ for Diamonds, ’H’ for Hearts, ’S’ for Spades.
Fall 2014
Finally, we represent a card by a string of length 2, the first character being the rank and the second being the suit. For example, Queen of Hearts is represented by ’QH’, and 3 of Clubs is represented by ’3C’.
In the game of bridge, a hand consists of 13 cards, which we represent by a list of cards. When given a hand, here is the common way to count points.
High rank points:
• For each Ace, we count 4 points.
• For each King, we count 3 points. • For each Queen, we count 2 points. • For each Jack, we count 1 point.
Short suit points:
• For each suit, we count 1 point if the hand contains exactly two cards of that suit. • For each suit, we count 2 points if the hand contains exactly one card of that suit. • For each suit, we count 3 points if the hand contains no cards of that suit.
On the next page, write a function which takes a hand as input and returns the number of points in that hand.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:30
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
question
Computers and Technology, 23.06.2019 06:30
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
question
Computers and Technology, 24.06.2019 17:40
Which of the following processes applications across multiple computing devices? a. functional application b. distributed system c. workgroup information silo d. information silo
Answers: 3
You know the right answer?
The ranks are: 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace. The suits are: Clubs, Diamonds, H...
Questions
question
Social Studies, 19.10.2019 00:30
Questions on the website: 13722362