1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Naya [18.7K]
4 years ago
7

The programming projects of Chapter 4 discussed a Card class that represents a standard playing card. Create a class called Deck

OfCards that stores 52 objects of the Card class. Include methods to shuffle the deck, deal a card, and report the number of cards left in the deck. The shuffle method should assume a full deck. Create a driver class with a main method that deals each card from a shuffled deck, printing each card as it is dealt.

Computers and Technology
1 answer:
RideAnS [48]4 years ago
3 0

Answer:

Check the explanation

Explanation:

====================Card.java====================

package card_game;

public class Card {

public final static int ACE = 1;

public final static int TWO = 2;

public final static int THREE = 3;

public final static int FOUR = 4;

public final static int FIVE = 5;

public final static int SIX = 6;

public final static int SEVEN = 7;

public final static int EIGHT = 8;

public final static int NINE = 9;

public final static int TEN = 10;

public final static int JACK = 11;

public final static int QUEEN = 12;

public final static int KING = 13;

public final static int CLUBS = 1;

public final static int DIAMONDS = 2;

public final static int HEARTS = 3;

public final static int SPADES = 4;

private final static int NUM_FACES = 13;

private final static int NUM_SUITS = 4;

private int face, suit;

private String faceName, suitName;

// -----------------------------------------------------------------

// Creates a random card.

// -----------------------------------------------------------------

public Card() {

face = (int) (Math.random() * NUM_FACES) + 1;

setFaceName();

suit = (int) (Math.random() * NUM_SUITS) + 1;

setSuitName();

}

// -----------------------------------------------------------------

// Creates a card of the specified suit and face value.

// -----------------------------------------------------------------

public Card(int faceValue, int suitValue) {

face = faceValue;

setFaceName();

suit = suitValue;

setSuitName();

}

// -----------------------------------------------------------------

// Sets the string representation of the face using its stored

// numeric value.

// -----------------------------------------------------------------

private void setFaceName() {

switch (face) {

case ACE:

faceName = "Ace";

break;

case TWO:

faceName = "Two";

break;

case THREE:

faceName = "Three";

break;

case FOUR:

faceName = "Four";

break;

case FIVE:

faceName = "Five";

break;

case SIX:

faceName = "Six";

break;

case SEVEN:

faceName = "Seven";

break;

case EIGHT:

faceName = "Eight";

break;

case NINE:

faceName = "Nine";

break;

case TEN:

faceName = "Ten";

break;

case JACK:

faceName = "Jack";

break;

case QUEEN:

faceName = "Queen";

break;

case KING:

faceName = "King";

break;

}

}

// -----------------------------------------------------------------

// Sets the string representation of the suit using its stored

// numeric value.

// -----------------------------------------------------------------

private void setSuitName() {

switch (suit) {

case CLUBS:

suitName = "Clubs";

break;

case DIAMONDS:

suitName = "Diamonds";

break;

case HEARTS:

suitName = "Hearts";

break;

case SPADES:

suitName = "Spades";

break;

}

}

// -----------------------------------------------------------------

// Determines if this card is higher than the parameter. The

// second parameter determines if aces should be considered high

// (beats a King) or low (lowest of all faces). Uses the suit

// if both cards have the same face.

// -----------------------------------------------------------------

public boolean isHigherThan(Card card2, boolean aceHigh) {

boolean result = false;

if (face == card2.getFace()) {

if (suit > card2.getSuit())

result = true;

}

else {

if (aceHigh && face == ACE)

result = true;

else if (face > card2.getFace())

result = true;

}

}

=========================Sample output=======================

You might be interested in
What is the danger in judging someone according to his or her social networking profile
AfilCa [17]
They could find you and throw hands.
8 0
3 years ago
based on the transcript, what did broadcasting the story through the medium of radio allow welles to do?
tamaranim1 [39]

Answer:

It was Halloween morning, in 1938, Orson Welles opened his eyes just to discover himself as the most trending person in the USA. Just the past night, Welles together with his Mercury Theatre performed the radio adaption of the Wars of the Worlds, written by H.G. Wells. He transformed around 40 years old novel into the false news edition which broadcasted the news of Martian attack on New Jersey.

Explanation:

It was Halloween morning, in 1938, Orson Welles opened his eyes just to discover himself as the most trending person in the USA. Just the past night, Welles together with his Mercury Theater performed the radio adaption of the Wars of the Worlds, written by H.G. Wells. He transformed around 40 years old novel into the false news edition which broadcasted the news of Martian attack on New Jersey. Just previously it was Halloween night, and hence, this was expected. And various listeners of the show were shocked, and they made a lot of crazy calls to the nearby Police Stations, as well as the newspaper publication houses. The radio stations tried to convince various journalists that the radio episode was able to cause hysteria throughout the USA. And by the very next dawn, the front column of each new newspaper from coast to coast together with the headlines related to the huge panic inspired allegedly by the CBS broadcast.

8 0
3 years ago
Newt Corporation, headquartered in Los Angeles, is a nationwide provider of educational services to post-graduate students. Due
zysi [14]

Answer:

Option B i.e., Circuit level gateways only enable data to be inserted into a network which is the product of system requests within the network.

Explanation:

In the above question, some details are missing in the question that is options.

Option B is valid because Circuit level gateways are not the transmission inspection, always require information into such a server resulting through system appeal inside the server through maintaining a record for connections that are sent into the server and only enabling information in this is in answer to such queries.

Other options are incorrect because they are not true according to the following scenario.

5 0
4 years ago
6 + 7 = 7 + 6 is an example of which property of addition?
Sauron [17]

Answer:

commutative

Explanation:

The commutative property states that the numbers on which we operate can be moved or swapped from their position without making any difference to the answer.

8 0
3 years ago
Read 2 more answers
You suspect that the Web Server, which is located on your network and hosts multiple Internet facing Websites. The Web Server ru
makkiz [27]

Answer:

Block all incoming ICMP requests.

Explanation:

Since  the  web  server  is  hosts  a  lot  of  internet  facing  websites .On investigation it was find out that the web server  is getting  flooded  with  a  lot of  ping  requests  hence  it  becomes unavailable  occasionally. So  to  tackle  this  problem  we  should  block  all  of  the  incoming  ICMP  requests.

5 0
4 years ago
Other questions:
  • Which online text source would include a review of a new TV show?
    9·2 answers
  • When you write Click a picture in a word processing program which actions can you choose to perform on the image
    6·1 answer
  • What is IaaS? For this service model, what are the resources the cloud vendor will provide/manage and what are the resources the
    15·1 answer
  • What are the four types of technical drawing?​
    9·1 answer
  • How do you know if something is in the public domain
    5·1 answer
  • In his digital portfolio, Ben wants to locate each work he created. Where can he list details about the work in his digital port
    7·2 answers
  • I'm not sure how to do these. By the way, it has to be python.
    13·1 answer
  • View which is used to specify the tables fields , their data types and properties ​
    9·2 answers
  • In order to detect repeated lines anywhere in the input, myuniq must keep track of all of the lines it has seen as it moves thro
    9·1 answer
  • he superclass Student contains: a constructor that accepts a String corresponding to the name of the school the student attends
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!