Reference no: EM13941449
Develop a program that plays "Five Card Stud". The user plays agains the computer. The program will "deal" five cards to the user and itself. Whoever has the highest hand wins. Inform the user who has won that hand, and ask if the user wants to play again. Interaction is as follows:
Your hand is:
2 of hearts
3 of diamonds
4 of clubs
2 of clubs
3 of hearts
My hand is:
Ace of clubs
Ace of hearts
Ace of diamonds
King of clubs
King of hearts
I win, sorry...
Play again (y,n)? n
Thanks for playing.
You need to develop 4 classes for this program. They are the Card, Deck, and Hand classes and the class containing your main method.
The Card class must contain (at least) the following methods:
Card() - constructor that initialized the value and suit of the Card
getValue() - returns the current value of the Card
getSuit() - returns the current suit of the Card
equals() - returns true when the passed Card is equal to the current Card
compareTo() - compares two Cards (passed and current) returning -1, 0 or 1
toString() - returns the string representation of the current Card, i.e. "King of hearts"
The Deck class must contain (at least) the following methods:
Deck() - constructor that initializes the Deck of Cards
shuffle() - shuffles the Deck
deal() - returns the Card on the top of the Deck
Implement the Deck as an array of Cards.
The Hand class must contain (at least) the following methods:
equals() - returns true when the passed Hand is equal to the current Hand
compareTo() - compares two Hands (passed and current) returning -1, 0 or 1
toString() - returns the string representation of the current Hand, i.e. "King of heartsn2 of clubsn etc..."
Implement the Hand as an array of five Cards.
The fourth class is your main method class. It is implemented procedurally.
Opportunity to demonstrate knowledge and skills
: The project provides an opportunity to demonstrate knowledge and skills in conducting a work analysis.
|
Describe the production cycle of beef cattle
: Describe the production cycle of beef cattle. What does it take to be a successful beef cattle producer? Things you may want to consider: how females and bull should be cared for and managed, how calves should be managed, etc
|
State your chosen company and project overview
: Restate your chosen company and project overview - Wrap the report up in a couple of sentences, stating your overall progress and affirming that you are on track or have a plan for catching up.
|
What are some factors that drive up the price of gold
: What are some factors that drive up the price of gold? What are factors that drive it down?
|
Develop a program that plays "five card stud"
: Develop a program that plays "Five Card Stud". The user plays agains the computer. The program will "deal" five cards to the user and itself. Whoever has the highest hand wins. Inform the user who has won that hand, and ask if the user wants to pl..
|
The expected return on a portfolio
: The expected return on a portfolio: can never exceed the expected return of the best performing security in the portfolio. must be equal to or greater than the expected return of the worst performing security in the portfolio.
|
Corporate culture and hr management in multinational
: Based on the information sourced in your research how would Hofstede's dimensions influence corporate culture and HR management in multinational T&H organisations based in your chosen country?
|
What was the average real return on the stock
: You’ve observed the following returns on Doyscher Corporation’s stock over the past five years: –28.8 percent, 16.2 percent, 35.4 percent, 3.6 percent, and 22.6 percent. The average inflation rate over this period was 3.36 percent and the average T-b..
|
Does increase in immigration lead to an increase in crime
: An increase in immigration may lead to an increase in different types of criminal activitydescribe and summarize the data sources that deals with research question above and examined.
|