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]
2 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]2 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 is the value of count after this nested FOR loop executes fully.
Alisiya [41]

Answer:

168 (although the =< must be corrected to <=)

Explanation:

int count = 0;

for (int row = 4; row <= 15; row++)

for (int col = 0; col < 13; col = col +2)

count+=2;

The inner for loop runs 7 times (for col = 0,2,4,6,8,10,12). Anything higher is not less than 13. Therefore the inner loop increments count by 2 seven times, i.e. it increments count by 14.

The outer for loop runs 12 times (for row = 4,5,6,7,8,9,10,11,12,13,14,15).

If the count is incremented by 14 twelve times, you are incrementing it by 14*12 = 168.

Therefore the count goes from 0 to 168 after the nested loops.

5 0
3 years ago
Briefly describe the function of storage media
SIZIF [17.4K]

Answer:

In computers, a storage medium is any technology -- including devices and materials -- used to place, keep and retrieve electronic data. It refers to a physical device or component in a computing system that receives and retains information relating to applications and users. The plural form of this term is storage media.

Early forms of storage media included computer paper tape. Holes punched in the paper corresponded to a single bit of data. A paper tape reader would interpret each punched hole and convert it to a number. Paper tape was supplanted by magnetic tape, which eventually evolved to magnetic floppy disk.

How storage media works:

Media used in computer storage receive messages in the form of data, via software commands from the computer system. The commands determine the type of storage media needed to hold the data, based on its business value, compliance implications or other factors. In tiered storage, data is moved among disk, flash and cloud storage based on automated software policies.

A storage medium may be internal to a computing device, such as a computer's hard drive, or a removable device such as an external hard drive or universal serial bus (USB) flash drive. There are various types of storage media, including magnetic tape, nonvolatile memory cards, rotating fixed disk and solid-state drives (SSDs), which are based on nonvolatile flash memory.

The term storage encompasses all data, and can be either primary or secondary storage. Primary storage refers to data that is kept in memory for fast retrieval by a computer's processor. Secondary storage is data placed on hard disk or tape to ensure backup and long-term retention.

A storage device may be a type of storage media, or a piece of storage hardware outfitted with storage media. For example, storage arrays decouple storage media from servers. Storage arrays incorporate electromechanical hard disk drives (HDDs), SSDs or a combination of each, attached to separate servers and networking.

Storage media can be arranged for access in many ways. Some well-known arrangements include:

redundant array of independent disks (RAID);

network-attached storage (NAS); and

storage area network (SAN).

SAN arrays initially were designed with HDDs, until the advent of all-flash arrays outfitted solely with SSDs. Hybrid flash arrays blend the two storage media in an integrated system, with disk providing a capacity tier alongside a faster tier of flash.

Explanation:

please mark me as brainliest

4 0
2 years ago
The text discusses three approaches to combining overall cost leadership and differentiation competitive advantages. Which of th
dedylja [7]

Answer:

C. deriving benefits from highly focused and high technology markets

Explanation:

Firms that engage in cost-leadership approach seek to combine a low per-unit income with large sales for profit making purposes. Typically, but not always, they are more inclined to market their products and services to a large population base or a niche with a high demand volume. While differentiation enables a company to accomplish a competitive advantage. A Competitive advantage enables a company to achieve more strides over other companies offering related product substitutes. It is an important marketing process that is of critical economic importance to a business.

It should be noted that deriving benefits from highly focused and high technology markets is not part of the approaches to combining overall cost leadership and differentiation competitive advantages.

3 0
3 years ago
The property that allows a metal to be drawn into wires is called...
GaryK [48]

Answer:

Malleability and ductility

Explanation:

Metals are also easily distinguished from non-metals and other materials in their ductility (ability to be drawn into a wire) and malleability (the ability to be beaten into a. sheet).

Did you need help on this with an assignment? Hope this helps!

6 0
2 years ago
At the time of signing, what was the title of the man who is the first of the two names in the name of the 1901 treaty that null
pshichka [43]
The answer is the US Secretary of State.  <span>At the time of signing,Secretary of State was the title of the man (John Hay) who is the first of the two names in the name of the 1901 treaty that nullified the Clayton-Bulwer Treaty. </span>It was signed by US Secretary of State John Hay and British Ambassador to the United States Lord Pauncefote on the 18th of November 1901. 
3 0
3 years ago
Read 2 more answers
Other questions:
  • In the following statement:
    12·1 answer
  • Which key on a laptop keyboard is often used to help pair a mobile device with another device for communication purposes?
    12·1 answer
  • Rachel works in a bank. She wants to present the idea of implementing an IS to the management. How should Rachel describe the IS
    9·2 answers
  • TLO 06 Active Directory Domain and Trusts tool is used to move servers between site in an AD Infrastructure.a. Trueb. False
    14·1 answer
  • Which of the following scenarios can best be addressed by operations management?
    11·1 answer
  • write a program with total change amount as an integer input and output the change using the fewest coins, one coin type per lin
    8·1 answer
  • Looking for friends, anyone up for it?
    12·2 answers
  • Rate my dog out of ten give explanation why
    12·1 answer
  • What is the output of the following code?
    5·1 answer
  • Which of the following statements best illustrates how value was created for eggs? when a farmer sells a chicken who is no longe
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!