Create a UML diagram for the card game Go Fish.

Answers

Answer 1

A UML diagram for the card game Go Fish is given below:

The UML Diagram

-------------------------

|        Player         |

-------------------------

| -hand: List<Card>     |

| -score: int           |

| +getPlayerName(): String|

| +getHand(): List<Card>|

| +getScore(): int      |

| +addCardToHand(card: Card): void|

| +removeCardFromHand(card: Card): void|

| +addToScore(points: int): void|

| +hasCard(rank: Rank): boolean|

| +getMatchingCards(rank: Rank): List<Card>|

| +askForCard(player: Player, rank: Rank): List<Card>|

| +goFish(deck: Deck): Card|

-------------------------

        |                  ^

        |                  |

        |------------------|

        |                  |

-------------------------  |

|         Card          |  |

-------------------------  |

| -rank: Rank           |  |

| -suit: Suit           |  |

| +getRank(): Rank      |  |

| +getSuit(): Suit      |  |

| +toString(): String   |  |

| +equals(other: Object): boolean|

| +hashCode(): int      |  |

-------------------------  |

        |                  ^

        |                  |

        |------------------|

        |                  |

-------------------------  |

|         Rank          |  |

-------------------------  |

| ACE                   |  |

| TWO                   |  |

| THREE                 |  |

| FOUR                  |  |

| FIVE                  |  |

| SIX                   |  |

| SEVEN                 |  |

| EIGHT                 |  |

| NINE                  |  |

| TEN                   |  |

| JACK                  |  |

| QUEEN                 |  |

| KING                  |  |

-------------------------  |

        |                  ^

        |                  |

        |------------------|

        |                  |

-------------------------  |

|         Suit          |  |

-------------------------  |

| CLUBS                 |  |

| DIAMONDS              |  |

| HEARTS                |  |

| SPADES               |  |

-------------------------  |

        |                  ^

        |                  |

        |------------------|

        |                  |

-------------------------  |

|         Deck          |  |

-------------------------  |

Read more about UML diagram here:

https://brainly.com/question/13838828

#SPJ1


Related Questions

Shady lady Mortgage Company requires an insurance down payment on all its mortgages based on the
following schedule:
5% on the first $25,000
3% on the remaining balance Develop the logic required for a program to computer the down payment requires by the mortgagee and list the mortgagee's account number and name. The input data record will contain name, account number,
and mortgage amount. Use functions. Add comments and use the output formatting for the
currency.

Answers

An Illustrative Depiction and Programming Sample in Python:

The Python description

Define a function to compute the premium for an insurance down payment related to the sum of one's mortgage.

In this part,

a. Create an intial value of 0.

b. Should the amount obtained be less than or equal to $25,000, then calculate 5% of the mortgage as the down payment.

c. Conversely, should the mortgage be more than $25,000, use the formula provided -- 5% of $25,000 and an additional 3% on any additional funds over the set amount --for down payments.  

Now, within the main function:

a. Procure all required data so as to enter each user’s name, account number, and procedure for mortgaging funds for measurement in said equation.

b. Thereafter contact the aforementioned calculator of the insurance down payment, being sure to provide it with the sum of the mortgage as input, from which it will generate the final sum required for that particular premium.

c. Last, format the output displayed for the customer in currency mode—listing their account number, given name, and accurate representation of the needed down payment.

Read more about mortgage here:

https://brainly.com/question/1318711

#SPJ1

Other Questions
In this late 19th- and early 20th-century system, companies and individuals could purchase the labor of prison inmates from state and county governments. Group of answer choices marks-of-commendation system congregate-and-silent system convict-purchase system convict lease system A sample is considered as undisturbed when the area ratio is 10% or less Group of answer choices True False What type of test is familiar to children from all socioeconomic and ethnic backgrounds and features items that are at least familiar to all students taking the test You feed your dog canned food and you use an electric can opener to open the can. Now, whenever you use the can opener your dog comes running expecting food. According to classical conditioning, your dog's new running behavior is called the What happens after the conditioned stimulus is repeatedly presented on its own, without the unconditioned stimulus QUESTION 1: How are companies in the sharing economy like Uber, Lyft, and Airbnb changing the traditional norms of both business and products If the result returned from a subquery must be compared to a group function, then the inner query must be nested in the outer query's ____ clause. The actions an organization should take while an incident is in progress are defined in a document referred to as the ____ plan. the term for a geographic locations height above se leaval is what Which of Mendel's Principles states that the two alleles present at each gene locus separate from one another during gamete formation and remain distinct The status of public recognition that an accrediting agency grants to an education institution or program that meets agency standards or requirements is known as: The probability of snow for each of the next three days is $\frac{2}{3}$. What is the probability that it will snow at least once during those three days The Communications Assistance for Law Enforcement Act (CALEA) said that Group of answer choices a key escrow system must be provided so that communications can be decrypted (with a court order) agents of a foreign power may be wiretapped with authorization from a secret court telecommunications equipment must be designed to allow the interception of telephone calls (with a court order) e-mail should have the same degree of legal protection as telephone calls The straight-line total revenue function suggests the firm may sell additional output without having to lower the price of the product. true or false Group problem-solving tends to produce solutions that are superior to solutions produced by individuals, because MY OPINION: dog the rooster REASON 1:because friends REASON 2: when u have dog safe toCONCLUSION: to be friends with rooster Internal auditors must make a preliminary assessment of risks when conducting an assurance engagement. This assessment may involve quantitative (objective) and subjective factors. The least subjective factor is Which theory of media's impact emphasizes the fact that adolescents choose the media to which they are exposed _______________________only occur in the Northern Hemisphere, as the Southern Hemisphere has no landmasses at appropriate latitudes (between 40 and 70) A) Tropical A climates B) Dry climates (B) C) Mid latitudes climates (C) D) Severe Mid latitude climates (D) For Problem 7.2, calculate the minimum cycle length and the effective green time for each timing stage (balancing v/c for the critical movements). Assume the lost time is 4 seconds per timing stage and a critical intersection v/c of 0.95 is desired