Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write a class (and a client class to test it) that encapsulates a deck of cards. A deck of cards is made up of 52 cards. You should have three instance variables:

-a two-dimensional array of values representing the cards

-a single-dimensional arrary describing the suit: spades, hearts, diamonds, and clubs

-an instance variable representing the trump suit

For the two-dimensional array, dimension 1 represents the suit and dimension 2 represents the type of card (ace, two, three...,jack, queen, king). Your constructor should take one parameter, which will represent the suit of the trump. Based on that , the cards should be given the follwoing values:

-Non-trump for 2 to 10: 1 point

-Non-trump jack = 2

-Non-trump queen = 3

-Non-trump king = 4

-Non-trump ace = 5

-Any trump card = Non-trump value +1

You should include the following methods:

-a method returning the trump suit, by name

-a method printing the whole deck of cards, suit by suit, with the value for each card

-a method taking a String as a parameter representing a suit, and returning the total value of the cards of that suit

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9902192

Have any Question?


Related Questions in Computer Engineering

In 2015 caterpillar inc had about 757 million shares

In 2015, Caterpillar Inc. had about 757 million shares outstanding. Their book value was $41.0 per share, and the market price was $93.50 per share. The company's balance sheet shows that the company had $34.50 billion o ...

What is the relationship between an interface and a

What is the relationship between an interface and a type? What is the relationship between a class and a type? What is the relationship between a subclass and a type?

What is the types of cost fixed variable and marginal in

What is the types of cost: fixed, variable, and marginal in economics, and methods that market power alters the relationship between a firm's costs and the price at which it sells its product?

Explain the risk of having hacking tools installed on your

Explain the risk of having hacking tools installed on your computer and why you should contact local law enforcement agencies before installing those tools.

Whats the difference between a bigfile tablespace and a

What's the difference between a Bigfile tablespace and a Smallfile tablespace? Explain which you would use for your database and why.

Assume the following for the town of boone it has a total

Assume the following for the town of Boone: it has a total population of 40,000 people, of which 1,000 are under 16 years of age or are institutionalized; 8,000 are full-time students who are not employed and are not see ...

Explain and discuss the following quotepoliticians can be

Explain and discuss the following quote: "Politicians can be strange. They have been calling for the breakup of firms as diverse as energy companies and tech giants like Microsoft and Google because they believe these co ...

1 what is the boolean expression for an and gate2 what is

1. What is the Boolean expression for an AND gate? 2. What is the Boolean expression for an OR gate? 3. What is the Boolean expression for a NOT gate?

In relation to internet connectivity both you and the

In relation to Internet connectivity, both you and the chemists at Plains Research are concerned about security. What network device or devices can be used to address the concern about security?

Explain the difference between penetration tests and

Explain the difference between penetration tests and security tests. Emphasize that this book will explain things from a security testing perspective.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As