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
When do you use FTP?
Sergeeva-Olga [200]
FTP (File Transfer Protocol) can be used for a variety of tasks. For instance, webmasters using FTP for pushing updates/files to their websites can provide easy and straightforward changes to their services without the need to physically transfer files onto the host server. FTP should be used when you must update a file or files on a host server for a variety of reasons and you do not have access to the host server physically. However, FTP also has some inherent security risks which is why some webmasters/hosts chose to opt out of pushing updates through FTP in favour of physical file transfer.
5 0
3 years ago
Read 2 more answers
Give two reasons why cloud computing could be detrimental to a company.
dimulka [17.4K]

Security/Insider threats.

As much as cloud computing is good for your organization, just know that someone is looking after your data. The cloud provider does everything for you from maintenance to managing security. The bigger picture here is that users are entrusting their data to someone else. Although the work of cloud providers is to ensure that your data is safe, some are not always looking after your best interests.

Cyber-attacks.

Any time your data is stored on the cloud, you are at a higher risk of cyber-attack. Vulnerabilities such as DDoS attacks might occur and this single point of failure is in the cloud. As cloud computing continues to become more sophisticated, so do cyberattacks. As much as the security is right, hackers will go to any lengths to penetrate the systems.  


3 0
3 years ago
Do individuals have a privacy interest in their smartphones' locations?
Rzqust [24]

Answer:

In today's world, everyone using smartphones as it easily allow to communicate by using different types of features like texting, video, e-mail and by using internet we can run various types of applications.

Smartphones carries one of the main and important skills that is show our current location. By using various types of applications like Global positioning system (GPS), cell ID and wifi we can easily trace the location.

But there is different types of option according to the individual requirement as some people want privacy as they are not interested to share their location to anyone.

6 0
3 years ago
Is a ROUTER required for Internet Connectivity ?<br> Yes<br> No
Kazeer [188]

no it is not but u will need a ethernet cord

5 0
2 years ago
Direct messages are the only private forms of communication on Twitter. True False
Sunny_sXe [5.5K]
True but ill keep typing so it meets twenty charecters                                              

7 0
3 years ago
Other questions:
  • What does Verizon child allow parents to do? My parents recently got the app and put it on my phone so I was wondering...
    11·1 answer
  • Alpha Technologies, a newly established company, wants to share information about its work with people all over the world. Which
    9·1 answer
  • Which process refers to starting up a computer?
    9·2 answers
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • A ____ is a device that interconnects two or more workstations in a star-wired bus local area network and immediately retransmit
    9·1 answer
  • A database administrator (DBA) must have a clear understanding of the fundamental business of an organization, be proficient in
    11·1 answer
  • What type of encryption is this "1d83ad29cf19ff399445aff3a0da74d9"
    5·1 answer
  • What is the difference between head header and heading in HTML​
    8·1 answer
  • Sarah has prepared a project document about the small and medium-sized companies in the United States. While proofreading, she r
    11·2 answers
  • How are Earth's plates made?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!