Select Page

Your Perfect Assignment is Just a Click Away

Starting at \$8.00 per Page

100% Original, Plagiarism Free, Customized to Your instructions!

## University of New Haven Python Program Paper

### Question Description

Help me study for my Python class. I’m stuck and don’t understand.

## Background Information

In this assignment, you will write a program to score a five-card cribbage hand. Here are the rules for scoring:

• A hand consists of five different cards. Each card contains a rank and a suit. All ranks will be “two”, “three”, “four”, “five”, “six”, “seven”, “eight”, “nine”, “ten”, “jack”, “queen”, “king” or “ace”. All suits will be “clubs”, “diamonds”, “hearts” or “spades”.
• If all five cards have the same suit, that is called a flush and is worth 5 points. For example, if all five cards are “diamonds”, that is a flush.
• If any two cards have the same rank, that is called a pair and is worth 2 points. For example, if the ranks of the cards are “two”, “two”, “two”, “five” and “five”, there are four pairs for a total of 8 points.
• If any two cards add up to 15, that is called a fifteen and is worth 2 points. An “ace” is worth 11, a “king” is worth 10, a “queen” is worth 10, a “jack” is worth 10, and all other cards are worth their face value (e.g. a “seven” is worth 7). For example, if the ranks of the cards are “six”, “seven”, “seven”, “eight” and “nine”, there are three fifteens for a total of 6 points. Note: In this simplified version of Cribbage, only pairs of cards that add up to 15 are worth 2 points. Fifteens that are produced by three or more cards are worth 0 points.
• The value of a hand is the sum of anything that scores points. For example, a hand consisting of a “three”, “four”, “four”, “six” and “nine” is worth 4 points (2 for the pair of “fours”, 2 for the fifteen).

## Assumptions

• The input file can contain any number of cribbage hands. Each line contains a five card cribbage hand in this format: Card 1 Rank, Card 1 Suit, Card 2 Rank, Card 2 Suit, Card 3 Rank, Card 3 Suit, Card 4 Rank, Card 4 Suit, Card 5 Rank, Card 5 Suit.
• All cribbage hands are valid.
• Note: Your program might be tested on a different set of cribbage hands so it is important to make your solution as general as possible.
• Note: The cards in a cribbage hand can appear in any order

*See Attachment for the code and output and input.

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results."

## Our Service Charter

1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.