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
marysya [2.9K]
3 years ago
12

Create a Card class that represents a playing card. It should have an int instance variable named rank and a char variable named

suit. Give it a constructor with two parameters for initializing the two instance variables and give it a getSuit() method and a getRank() method that return the values of the two instance variables. Then create a CardTester class with a main method that creates five Cards that make up a full house (that is, three of the cards have the same rank and the other two cards have the same rank) and prints out the ranks and suits of the five Cards using the getSuit() and getRank) methods
Computers and Technology
1 answer:
Helen [10]3 years ago
3 0

Answer:

Explanation:

The following code is written in Java. It creates the Card class and then uses it to create a full house and print out the rank and suit of every card in that hand.

class Card {

   int rank;

   char suit;

   public Card(int rank, char suit) {

       this.rank = rank;

       this.suit = suit;

   }

   public int getRank() {

       return rank;

   }

   public char getSuit() {

       return suit;

   }

}

class CardTester {

   public static void main(String[] args) {

       Card card1 = new Card(3, '♥');

       Card card2 = new Card(3, '♠');

       Card card3 = new Card(3, '♦');

       Card card4 = new Card(2, '♦');

       Card card5 = new Card(2, '♣');

       System.out.println("Card 1: " + card1.getRank() + " of " + card1.getSuit());

       System.out.println("Card 2: " + card2.getRank() + " of " + card2.getSuit());

       System.out.println("Card 3: " + card3.getRank() + " of " + card3.getSuit());

       System.out.println("Card 4: " + card4.getRank() + " of " + card4.getSuit());

       System.out.println("Card 5: " + card5.getRank() + " of " + card5.getSuit());

   }

}

You might be interested in
What does in-private or incognito browsing do?
Aleks04 [339]

All it does it let you browse the internet, but whatever you look up, it isn't put on your browser history.
5 0
2 years ago
In _____ conversion of the implementation phase of the systems development life cycle (SDLC), the old and new systems run simult
coldgirl [10]

Answer:

b. parallel

Explanation:

According to my experience on information technology, I can say that based on the information provided within the question the term being mentioned is called Parallel Conversion. Like mentioned in the question this term refers to when two systems run at the same time while transferring operations in order to make sure that everything is running correctly and are outputting the same results.

If you have any more questions feel free to ask away at Brainly.

8 0
3 years ago
What type of rain happens when cold air meets warm air
Elodia [21]
A tornado happens when you mix cold with hot
5 0
3 years ago
Handhed computer is otherwise called as<br> 1.laptop<br> 2.Notebook<br> 3.Palmtop
NikAS [45]

Answer:

personal digital assistants (PDAs)palmtop

3 0
3 years ago
When Creating a game ( Which I Am, FPS ofc ) what are the basic rules would you want to add
Gnesinka [82]

Answer:

2 ig

Explanation:

5 0
3 years ago
Other questions:
  • Derek found that the CPU was running several processes. While Derek was looking at Task Manager, the computer crashed. Derek res
    15·2 answers
  • DHCP and FTP servers listen for and send network traffic on:
    5·1 answer
  • Write a program that assigns two integer values from standard input to the variables int1 and int2, then prints "true" if they a
    10·1 answer
  • What are the 7 basic components found in a computer tower
    5·2 answers
  • In Windows Vista, the Run command can be found in which application?
    6·1 answer
  • Write a Python program calculate summary statistics about a class assignment. First, prompt the user for the number scores to be
    6·1 answer
  • What is the main feature of Ethernet over Power?
    9·1 answer
  • A. What is MS-Word ? Write its uses.
    14·2 answers
  • is a measurement that quantifies how much information can be transmitted over the network. A. Memory B. DMZ C. Bandwidth D. Clou
    10·1 answer
  • So im new how exactly does this point system work???​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!