Question: Identify the objects needed for the UNO card game and the actions that those objects perform, rather than how the objects are actually represented. For

Identify the objects needed for the UNO card game and the actions that those objects perform, rather than how the objects are actually represented. For example, a standard UNO card must be able to report both its color and value, and, when given another card, tell whether or not it is a "match". When specifying operations, think simplicity. "It's better to have a few, simple operations that can be combined in powerful ways, rather than lots of complex operations." (MIT, n.d.)

1. Prepare a documents that includes an ADT (abstract data type) for each object needed in the program. Discuss your selection of properties and methods for each each object. Following is a partial ADT example for UnoCard Class:

//get the color of the card

+getColor(): String

//set the color of the card

+setColor(color : String): void

//get the value of the card

+getValue(): int

//set the value of the card

+setValue(val : int): void

//return true if card has same value or

//same color as this card

//return false otherwise

+isMatch(card : Unocard): boolean

2. Design software that represents the objects needed for the UNO card game and instantiate and test these objects. Create a UML diagram and then write the code for the object classes needed for the UNO game with a minimum of 3 classes:

a. A Card class (models an individual UNO card)

b. A Hand class (models a player's hand)

c. A Deck class (models the entire UNO deck)

You may add other classes as you see fit.

Write a Java console application (a driver program) that creates a deck of UNO cards, deals the cards to four players, and displays the contents of each player's hand. Explain the interactions among the objects in your driver program in your comments.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!