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
VLD [36.1K]
4 years ago
11

A Color class has a method getColorName that returns a string corresponding to the common name for the color, e.g., yellow, blue

, white, etc. If there is no common name associated with the color, null is returned. The class, AlphaChannelColor-- a subclass of Color-- has an integer instance variable, alpha, containing the alpha channel value, representing the degree of transparency of the color. Write the method getColorName of AlphaChannelColor, that overrides the method in the Color class. AlphaChannelColor's getColorName should return the name of the color (obtained from the getColorName method of Color) prefixed with the word 'opaque' if the alpha value is less than 100, 'semi-transparent' if the alpha value is otherwise less than 200, and 'transparent' otherwise (separate the prefix from the color name by a blank). If the color has no name, the method should return "opaque color", "semi-transparent color", or "transparent color", according the the same alpha values as above.
Computers and Technology
1 answer:
Mashutka [201]4 years ago
6 0

Answer:

public String getColorName() {

String name = super.getColorName();

if (name == null) name = "color";

if (alpha < 100)

return "opaque " + name;

else if (alpha < 200)

return "semi-transparent " + name;

return "transparent " + name;

}

You might be interested in
_____________________________________________________is a pre-designed format to help users with the creation of a document, lik
Naily [24]
C template......................................
8 0
3 years ago
Which three pieces of information should be included in an artist statement? Select all that apply.
Dima020 [189]

Answer:

There is no answers given??

Explanation:

N/A

4 0
3 years ago
If you see these REPORT.
Alenkinab [10]

Answer:

ok will do

Explanation:

3 0
3 years ago
Read 2 more answers
What do people in japan use to make anime
lions [1.4K]

software programming like adobe flash.

8 0
3 years ago
Suppose you are asked to design a rotating disk where the number of bits per track is constant. You know that the number of bits
Olenka [21]

Answer:

suppose i was i would tell them i dont know and walk away

Explanation:

in thoery this is correct

you said suppose so i answerd

there is no use in reporting or getting this taken down

nether is it right

im not stealing points

Because in thoery its an answer

<em><u>THIS IS MY PROTEST</u></em>

6 0
3 years ago
Other questions:
  • What's the risk or effect of software piracy?
    12·2 answers
  • What does "FDDI" stand for in Technology?
    5·2 answers
  • Templates allow for the quick creation of _____.
    7·1 answer
  • Define a function CoordTransform() that transforms its first two input parameters xVal and yVal into two output parameters xValN
    7·2 answers
  • The most complex part of ssl is the ___________ protocol.
    7·2 answers
  • The 8-bit ____ field is used by source network hosts and forwarding routers to distinguished classes or priorities in ipv6 packe
    11·1 answer
  • Which command can be used to find errors on a hard drive​
    6·1 answer
  • 10. List three adaptations of wind-pollinated plants to promote pollination.<br>​
    12·1 answer
  • Which storage is faster than secondary storage​
    14·2 answers
  • What do we call notes in computer code for the programmer that are ignored by the compiler?.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!