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
The banner on the front page of a newsletter that identifies the publication is the:.
podryga [215]

Answer:

Nameplate

Explanation:

The banner on the front of a newsletter that identifies the publication is its nameplate.

7 0
2 years ago
Thanks for asking me to ask a ques !!
Tamiku [17]

Answer:

I'm not sure what this means by Hope you have a great day :)

5 0
4 years ago
guys im so heartbroken. so i quit art. heres my laST piece of art i did. it took me a month. im burning it tonight. i quit art..
Helga [31]

Answer:

Ok

hsjsbsjwiqnsbsjsowiwi

5 0
3 years ago
Read 2 more answers
A _____ is a modeling tool used in structured systems analysis and design (SSAD) analysis model that helps break down a complex
Shalnov [3]

A <em>"DATA FLOW DIAGRAM"</em> is a modeling tool used in structured systems analysis and design (SSAD) analysis model that helps break down a complex process into simpler, more manageable, and more understandable subprocesses

8 0
4 years ago
Why does the PC send out a broadcast ARP prior to sending the first ping request
Norma-Jean [14]

Since the ARP broadcast is utilized to request the MAC address of the Host with the IP address contained in the ARP, the PC needs to know the destination of MAC address before it can produce the frame header for the particular PING requested, before it can send a PING to a host.

5 0
3 years ago
Other questions:
  • Assign to avg_owls the average owls per zoo. Print avg_owls as an integer. Sample output for inputs: 1 2 4 3
    7·1 answer
  • An existing document that you use as a starting point for a new document; it opens a copy of itself, unnamed, and then you use t
    15·1 answer
  • When a process becomes digital, it often becomes cheaper and the workflow becomes simpler. True False
    5·2 answers
  • _____ is a group of Internet-based applications that build on the ideological and technological foundations of Web 2.0, and that
    10·1 answer
  • Rerouting traffic using arp poisoning is an attack on ________ of a network.
    8·1 answer
  • A + B (AC (B +C’) D) = A + BD
    10·2 answers
  • Why is it important to ensure that your software is up to date?
    13·1 answer
  • What is an accessor in Java?
    12·1 answer
  • The first step of converting data into a table is:
    12·1 answer
  • What are the different types of computer operating systems?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!