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
What are the different ways to represent compounds? Check all that apply. a structural formula a ball model a space-filling mode
bagirrra123 [75]

Answer:

Compound can be represented as a molecular formula,empirical formula, structural formula,ball and stick model, space filling model.

Explanation:

Compounds can be represented as a chemical formula and a molecular model.

A chemical formula shows the number of atoms present in a compound. Whereas, the molecular model shows the geometry of a compound.

The chemical formula can be further divided into 3 types:

1)molecular formula: indicates the actual number of atoms in a compound.

2)empirical formula: indicates the relative number of atoms present in a compound.

3)structural formula: is illustrated in the forms of lines which actually shows the bond(such as covalent bond) and also shows how atoms are connected to each other in a molecule.

Molecular model is preferably a better way to represent a molecule. It is categorised into the following:

1)a ball and stick model: its a three dimensional representation of a compound. The atom(s) in a compound is represented by ball while, their chemical bonds are shown by sticks.

2)A space filling model: its a three dimensional structure,it represents the size and shape of the whole molecule,showing relatively how much space each atom in a molecule occupies.

7 0
3 years ago
Read 2 more answers
Donna is in the Outlook Today window and clicks the F1 button on her keyboard. What is Donna most likely trying to do?
Jobisdone [24]
I believe the answer is D. <span>use the Help feature of Outlook
In general, f1 is the shortcut to access help feature in almost all computer program.
Other than using this method, Donna could also use 'tell me what to do' phrase in the query box in order to access the feature.</span>
8 0
3 years ago
Read 2 more answers
A user reports that he cant browse to a specific website on the internet. From his computer, you find that a ping test to the We
ikadub [295]

Answer:

Incorrect DNS server address

Explanation:

7 0
2 years ago
A user is having an issue updating an app from Windows Store. Where you go to find more information on the error?
rusak2 [61]

Answer:

A d depends on computer

Explanation:

5 0
3 years ago
Select the correct answers. What are examples of real-time applications?
maksim [4K]

My answer to the question are:online money transfer,news update,blog post.

6 0
4 years ago
Other questions:
  • Mobile ethnography can be especially useful for documenting public behavior, such as waking up in the morning or administrating
    9·1 answer
  • Assume that an int variable age has been declared and already given a value and assume that a char variable choice has been decl
    9·1 answer
  • hi i'm bored so.... free point and if you have any Netflix shows that are good do tell also i'm going to pick one person to give
    7·2 answers
  • If a user wants to add an expansion card to increase the memory of a computer, where should the user insert the card?
    12·2 answers
  • Wireshark or any other monitoring software running on a single computer connected to a switch doesn't see all the traffic on a n
    10·1 answer
  • g Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative inte
    12·1 answer
  • A school’s administration stores the following data for each student in an online system: name, class, and five electives. Selec
    12·1 answer
  • 26. Universal Containers (UC) has a queue that is used for managing tasks that need to be worked by the UC customer support team
    11·1 answer
  • So has anyone opened the link/file those people are giving out as answers? Like what are they, viruses, answers, nothing??? Some
    9·2 answers
  • What are tasks performed by pascaline?​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!