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
ankoles [38]
3 years ago
13

For the questions below, consider a class called ChessPiece. This class has two instance data, String type and int player. The v

ariable type will store "King", "Queen", "Bishop", etc and the int player will store 0 or 1 depending on whose piece it is. We wish to implement Comparable for the ChessPiece class. Assume that, the current ChessPiece is compared to a ChessPiece passed as a parameter. Pieces are ordered as follows: "Pawn" is a lesser piece to a "Knight" and a "Bishop", "Knight" and "Bishop" are equivalent for this example, both are lesser pieces to a "Rook" which is a lesser piece to a "Queen" which is a lesser piece to a "King."22) Which of the following method headers would properly define the method neededto make this class Comparable?
A) public boolean comparable(Object cp)
B) public int comparable(Object cp)
C) public int compareTo(Object cp)
D) public int compare To( )
E) public boolean compareTo(Object cp)
Computers and Technology
1 answer:
Marina86 [1]3 years ago
3 0

public boolean comparable(Object cp) headers would properly define the method neededto make this class Comparable.

A) public boolean comparable(Object cp)

<u>Explanation:</u>

Chesspieces is class is declaring in programming languages such c++ or python or java. Inside Chesspiece class declare with two variables names, First variable  data type is string which holds names chess board character such as “Queen”, “king” , “Bishop”, and other variable stores Boolean values false or true.

This program is meant for chess games. Moreover the class been compared zero or one on each character of chess  games.

To compare end user pass the parameter and get the Boolean value either false or true.

You might be interested in
In 1-2 sentences, describe how to use the thesaurus in the Word Processor you have used.
jasenka [17]
Thesaurus is a tool use to find the synonym of the of a word.
Here's the way to use the thesaurus in the word processor.
=> highlight the word, then right-click, Navigate to synonyms and the words will  display.
3 0
3 years ago
Read 2 more answers
Selecting the Tiled windows arrangement option places the windows in a(n) _______ pattern on the screen.
Archy [21]

Answer:

Selecting the Tiled windows arrangement option places the windows in a(n) Grid pattern on the screen.

Explanation:

3 0
2 years ago
How are authentication and authorization alike and how are they different? what is the relationship, if any, between the two\?
Helen [10]
  Both authentication and authorization are terms used in information security and <span>intelligently controlling access to </span>computer<span> resources. </span><span>Authentication is the process where by an individual’s (user's) identity is confirmed, whereas authorization is the association of that identity with rights/</span>privileges and permissions to resources related to information security.

3 0
3 years ago
Read 2 more answers
\what security countermeasures can you enable on your wireless access point (wap) as part of a layered security solution for wla
dmitriy555 [2]
The security countermeasure that one can enable on a wireless access point as part of the layered solution for WLAN implementations would be to disable 802.1x . It is the one that provides a WEP and is very unsecure. Another is to change the SSID and to set the broadcast of the SSID to off.
5 0
3 years ago
which of the following scenarios is a circumstance in which it would be ethical to practice confidentiality?
Citrus2011 [14]
Hi. I am not sure if there should be choices included in your post. If there is none, I'll just share a circumstance to where a professional practices confidentiality as an answer. 

Counselors or psychotherapists can only divulge information about their clients or patients if there is a court order or if the client will harm him/her self or plan to harm others. Primarily, they are to respect the client's choice to keep the sessions with full confidentiality. 
4 0
3 years ago
Other questions:
  • HELP NOW PLZZ/ Question: Complete the sentence with the correct response.
    11·1 answer
  • The house had a wonderful pool of ... (his/its/our) own.​
    5·1 answer
  • In your own words, explain the role of scientific investigation in the development of the Theory of Evolution.
    6·1 answer
  • Write an expression that evaluates to true if and only if the value of the integer variable workedOvertime is true.
    7·1 answer
  • Chdtp aoxophg gr72 ae9&gt;3 zqqz
    12·1 answer
  • What is secondary exchange ? - Apex
    14·1 answer
  • John's Plumbing prides itself on excellent customer service, especially during after-hours service calls. They want to connect w
    11·1 answer
  • Which group on the Home Tab allows you to add shapes to a PowerPoint slide?
    9·2 answers
  • How many total cells can a worksheet window contain? If columns are labelled alphabetically, what will be the label for the cell
    15·1 answer
  • Which of the following statements describes the general idea of an assistive media​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!