Java help
JGRASP
Write a class named Card, which can be used to represent a card from a deck of cards. The class should be able to stores a cards suit and face value. A cards suit can be one of the following Hearts, Diamonds, clubs, Spades. A cards face vaule can be Ace, King, Queen, or Jack or a value in range in 2 thru 10.
Next write a Deck class. This class constructor should create a list of 52 cards objects, each representing a valid card in the deck. The class should have a shuffle method that randomly shuffles the Card objects in the list. It should also have a deal method that “deals” a card from the deck. It does this by removing the Card object at the beginning of the list and returning a reference to the object.
Next write CardPlayer class. The class should keep a list of Card objects that have been delt to it. This represents a hand of cards. A method named add should accept a reference to a Card object, which is added to the list. A method named showCards displays the card objects in the list.
Demonstrate these classes in an application that creates a Deck object, shuffles the cards it contains, and deals five cards from the Deck to a CardPlayer object. The CardPlayer should then display the 5 cards.
JGRASP Plus commenting
13 years ago
40
- Goverment where sovereignty rest with the people is called?
- can someone help me with this assigment?
- most sages of the axial age took which views of human nature?
- Jess takes a board that is 50 inches long and cuts it into two pieces, one of which is 26...
- Need help with fundamental of accounting chapter 4 exam
- the girl guides started to wash the fish pond at 3.45 p.m. they finished washing at 6.20 p.m. how long...
- please help with science
- Compare and contrast the relative value of trying to fill a position by considering persons already in the organization versus looking for persons outside the organization.
- A square pyramid is 6 feet on each side. The height of the pyramid is 4 feet. What is the...
- On July 27, 2007, Lois Murphy was found dead on the floor of her garage, a victim of an apparent...