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
$8.25/hour; _____$/year, when working 40 hours a week.
Katarina [22]
If you work 50 weeks/year and 40 hours/week, you will make 16,500 dollars per year if you make 8.25 per hour
8 0
3 years ago
You are trying to troubleshoot a desktop power supply issue using a voltmeter. Which of the following options are the MOST commo
vredina [299]

Answer:

The correct answers are: (A) +/- 5V and (B) +/- 12V

Explanation:

First at all, the purpose of the power supply is transforming from AC (Alternating Current) to DC (Direct Current) for use this energy in chips and electronics devices that consume this type of power. Usually the most common DC voltage for electronics is 5V but in your CPU you also have other devices that might going to need more voltage like fan or hard drives thats ´s why 12V is an also an option. Now some other devices are going to need negative sources such -5V or -12V as well.

7 0
3 years ago
What has impacted the world more: The initial creation of telephone or a smart cellphone? Explain your reasoning!
-BARSIC- [3]
If this is on personal opinion, I would say the initial creation of the telephone. Even though a smartphone practically kickstarted a whole era to technology that is still going on till this day, it was the telephone that started this all. If it wasn’t for the idea to create a phone that is more advanced than a box attached to the wall, none of these advancements would’ve happened at all. (Although that is uncertain, things do tend to have a way of working out in the end. If someone didn’t invent it, another person would’ve thought of it sooner or later.) But that is only if we’re talking long term, which I prefer because there was no limit to when the results of impact started in the prompt stated above, yet if we were to speak short term and the faster one, the credit would go to the smart cellphone. But we aren’t, because the question never specified ;)
5 0
3 years ago
Hoda wants to create a new presentation in PowerPoint with existing graphics and designs. What is the easiest and fastest way fo
Paul [167]

Answer: a

Explanation:

6 0
3 years ago
Alt text is considered a(n ____ attribute because it provides access to everyone who visits your site.
Vikentia [17]
Alt text is considered an accessibility attribute...
8 0
3 years ago
Other questions:
  • Help asap. 10 points.
    8·2 answers
  • A block style business letter is:
    5·1 answer
  • Refer to the exhibit. A web designer calls to report that the web server web-s1.cisco is not reachable through a web browser. Th
    15·1 answer
  • Helena purchased a security software package to protect her new laptop against threats such as spyware and computer viruses. she
    14·1 answer
  • Which increases the rate of soil formation?
    10·1 answer
  • Meaning of ‘integrity of data’
    14·2 answers
  • With a heat exchanger, the temperature of the process fluid can be measured with a temperature-
    14·1 answer
  • Read the following scenario. How might Sarah correct successfully complete her task?
    6·1 answer
  • Write about virus in five points.​
    8·1 answer
  • Explain the steps in starting the MS Access from the Start Menu.​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!