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
WordArt styles allow you to add ____.
maria [59]
As for this problem, the most probable and the most likely answer to this would be it depends on the person or the user of it since there aren't any options presented with the problem.

WordArt is there to be of use during presentations, during discussions, and other things. On the other hand, as the technological advancement takes leaps and bounds going forward, this utility seems to be underused and isn't expected to give a more impact to the reader or to the recipient of such document that contains it. This is typically used for people that aren't too familiar yet, as to how to utilize other programs to enhance their documents and files.
3 0
3 years ago
Why do software developers prefer to use high-level language to author programs?
Charra [1.4K]

Answer:

The answer to this question is given below in the explanation section

Explanation:

The correct answer to this question is: it used a more English-like syntax.

The software developer use high-level language to develop or author the program because it is more likely to English syntax and it would be easy for a software developer to author a program easily instead of using low level language and remembering ones and zeros.

Other options are not correct because:

It can be used on computers without microprocessors: Each computer has a microprocessor either you develop a program using high-level or low-level languages. Changes and modifications are easy in high-level language than in low-level languages. so, the option that prevents anyone from making changes to the software later is wrong.  However, high-level languages are less complicated in learning and in authoring the programs but it does not use zeros and ones, it uses English-like syntax. So, the last option is also wrong.  

4 0
2 years ago
What is the output of the following code?<br> print (12 // 6)
sveta [45]

Answer:

2

  • See here we have //
  • // means floor division in python.
  • It gives us only the integer part not floating or decimal.

So

12//6=2

8 0
2 years ago
Scrieți un program care citește un număr natural n și determină suma cifrelor divizibile cu 3 ale lui n.
Vika [28.1K]
Sorry I don't understand your question
5 0
3 years ago
To mitigate the effects of most of the common network threats including disruption, destruction and disaster, companies are begi
almond37 [142]

Question:

To mitigate the effects of most of the common network threats including disruption, destruction and disaster, companies are beginning to migrate their servers, networking devices and data into professional datacenters. This is called

A) Colocation

B) SAAS

C) Peering

D) Clustering

E) Server Farming

Answer:

The correct answer is A) Colocation

Explanation:

Colocation as already defined is the voluntary relocation of all network facilities to a data centre so as to reduce the risks of disaster, disruption, destruction, intrusion whilst increasing security, flexibility and scalability at a lower cost.

As the world gets more digitized, datacentres are getting more patronage. The sales figures show this.

Cheers!

6 0
3 years ago
Other questions:
  • What color model should Joe use if he will be using an offset printing press?
    7·1 answer
  • You have to communicate a signal in a language that has 3 symbols A, B and C. The probability of observing A is 50% while that o
    11·1 answer
  • How can you tell that a website is valid and reliable 10 points
    10·1 answer
  • 14. The Internet may best be compared to a/an
    13·2 answers
  • What is one reason that writing effective messages is so important
    11·2 answers
  • Why is a high-quality bond typically considered a lower-risk investment than a stock
    10·2 answers
  • What layer in the Transmission Control Protocol/Internet Protocol (TCP/IP) model is responsible for defining a way to interpret
    11·1 answer
  • The template code provided is intended to check whether an integer entered by the user is outside of the range 20-29 (inclusive)
    9·1 answer
  • A signal has a wavelength of 1 11m in air. How far can the front of the wave travel during 1000 periods?
    7·1 answer
  • Please respond not with answer but with comment.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!