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
Generate the requested sets using only set builder notation and the provided sets. Some problems may require you to build one or
Elenna [48]

The answer & explanation for this question is given in the attachment below.

5 0
3 years ago
to allow excel to change the cell references in a formula or function from row to row or column to column as you fill with it, y
posledela

to allow excel to change the cell references in a formula or function from row to row or column to column as you fill with it, you must use an formula cells.

8 0
2 years ago
Create a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop shou
Gala2k [10]

Answer:

import java.util.Scanner;

public class TestClock {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int sum = 0;

       char op;

       do{

           System.out.println("Enter two numbers");

           int num1= in.nextInt();

           int num2 = in.nextInt();

           sum = sum+num1+num2;

           System.out.println("Do you wish to perform another operation, Y/N");

           op =in.next().charAt(0);

       }while(op =='Y'||op=='y');

       System.out.println("sum "+sum);

   }

}

Explanation:

The code is implemented in Java progrmming language

  1. create an integer variable sum
  2. create a character variable op
  3. create a do while loop to request user to enter num1 and num2
  4. Request the user to also enter a char Y/N (yes or no repectively)
  5. While the char is Y keep adding up the sum and prompt the user to enter two new numbers
  6. Else break out of the loop and print the sum
6 0
3 years ago
What are the different components of the cloud architecture?
USPshnik [31]
To combine these components make up computing architecture.
8 0
3 years ago
Read 2 more answers
Use your own words to describe how IT/IS can support major functional areas in the business. Discuss at least two of these areas
slavikrds [6]

A business has many functions. A business functions are the activities that are carried out by an enterprise. The major business functions in an enterprise are-

<span>1.       </span>Planning

<span>2.       </span>Production

<span>3.       </span>Marketing & Sales

<span>4.       </span>Accounting & Finance

<span>5.       </span>Human Resource

Each of the above functional areas are majorly supported by information system. An enterprise IT department plans, operate and support all the above mentioned function, by enabling users to carry out their roles efficiently.

1.IT in Marketing & Sales (Marketing Information System)-

Marketing business activity includes planning, promoting and selling of goods and services to the end customers. Marketing information system supports decision making and to carry out various task smoothly.

Marketing information system depend on external data rather than other organizational information system. It covers data related to the information of marketplace. What are the potential marketplace for a given product?

Example- a Company is producing networking equipment. Then identifying the potential market segment, reaching out to the end customer, advertising about the product, identifying the renewal opportunities of the sold product, forecasting the sales of the next quarter/year etc. are all the part of marketing & sales information system.

2.IT in human resource-

Information system is helpful in Human resource function as well. Human resource information contains the data about all the present employees of the enterprise, and also it collects the data of the new candidate against any new vacancy. In human resource payroll management system consist all the information of the existing employees (personal information, salary, performance and promotion activities etc.).

An ideal human resource information system maintains & secure employee record, track employee skill, job performance and training, and support planning for employee compensation and career growth.

<span> </span>

8 0
3 years ago
Other questions:
  • Ben is writing web page content on a newly launched gaming gadget. He has to use hyperlinks to help visitors navigate to web pag
    11·1 answer
  • Problem 1: Create a list that contains the months of the year. Problem 2: Create a loop to print the month number and name (do n
    7·1 answer
  • It will gain you more knowledge, intensify your soft skills, strong work ethics and grow your network. What is it?​
    12·2 answers
  • Ideally an entity identifier is composed of _____ attribute(s).
    11·1 answer
  • You can minimize the Ribbon with a command contained on the _____.
    7·1 answer
  • Write a function definition for a function which takes one parameter and returns twice that parameter
    12·1 answer
  • When looking at aggregated logs, you are seeing a large percentage of Windows hosts connecting to an Internet Protocol (IP) addr
    5·1 answer
  • Assume there is a 30-byte heap. The free list for this heap has two elements on it. One entry describes the first 10-byte free s
    15·1 answer
  • ¿Qué son las tecnologías modernas?
    6·1 answer
  • Continue your S3 and S4 assignment for a young soccer league with the following specification. Do not include the previous queri
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!