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
Klio2033 [76]
3 years ago
5

A) Write a class Card. A Card has the following private attributes:

Computers and Technology
1 answer:
Over [174]3 years ago
6 0

Answer:

Java.

Explanation:

public class Card

{

   String Suit;

   int value;

   public Card(int value, String Suit) {

       self.value = value;

       // Check Suits value

       if ((Suit == "hearts") || (Suit == "spades") || (Suit == "clubs") || (Suit == "diamonds"))

           self.Suit = Suit;

       else {

           Suit = "none";

           throw new IllegalArgumentException("no card of this type exists.");  

        }

   }

   public String getSuit() {

       return Suit;

   }

   public int getValue() {

       return value;

   }

 

   public void print() {

       System.out.println("%d of %s", value, Suit);

   }

}

public class Deck {

}

You might be interested in
How many people watch Anime in the world?
iren [92.7K]
3 to 4 billion people.

7 0
3 years ago
Read 2 more answers
To print the number of elements in the array named ar, you can write :
Diano4ka-milaya [45]

Answer:

Option c is correct.

Example :

public class Subject

{

public static void main(String [] args)

{

int ar[]={5,4,6,7,8};

System.out.println("the number of array elements are: ",ar.length);

}

}

Explanation:

The above program is created in java language in which Subject is a class name.Inside Subject class , there is main method.

Inside the main method, there is An array named 'ar' which data type is an integer and we have assigned the value to this array.

in the next line, we are printing the total no. of the element in the array with the length function which displays the length of an array or variable.

8 0
3 years ago
How do you copy a file​
trasher [3.6K]

Answer:

right click and press control c

8 0
3 years ago
Creating a wedding website on the knot- how to make the text wide
Nady [450]

Answer:

go to the side with you mouse drag it ove or the restoere down button at the top right in between the - and the x hope this haelp may you mark me as brainlyest pls and thank you have a  bless day <3

Explanation:

3 0
2 years ago
Please help ASAP!
makkiz [27]
B. training is the correct answer
8 0
2 years ago
Other questions:
  • Attention merchants define
    5·1 answer
  • Constructors ________. initialize instance variables when overloaded, can have identical argument lists when overloaded, are sel
    11·1 answer
  • Antivirus software installed to scan and monitor malware activities on a server or workstation would be identified as a ________
    8·1 answer
  • Which of the following is a rule of thumb for cell phones or smartphone etiquette ?
    12·1 answer
  • Susan has always wanted to be a veterinarian. When doing her research, she answers all self-assessments geared toward that caree
    13·1 answer
  • What will be result of below if statement.
    13·1 answer
  • We can create tables in MS. Word from *<br> 2 points<br> Insert Tab<br> Home Tab<br> Mailings Tab
    5·2 answers
  • MULTIPLE COICE! BRAINLIEST
    12·1 answer
  • In this exercise we will practice using loops to handle collections/containers. Your job is to write a program that asks the use
    6·1 answer
  • Suppose the cache access time is 10ns, main memory access time is 200ns, and the cache hit rate is 90%. Assuming parallel (overl
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!