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]
3 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]3 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
What should you include in a persuasive speech
Vlad [161]

Answer:

Come up with a controversial topic, one that make your listeners think

Research the topic thoroughly that you have chosen

Understand the perspective of your audience. Keep your goal in mind. You are trying to persuade the audience to do or believe something .

7 0
3 years ago
g Write a function named vowels that has one parameter and will return two values. Here is how the function works: Use a while l
lianna [129]
10-20-100.40 = my bin =nice
5 0
2 years ago
In a bubble sort, you use a(n) ____ loop to make pair comparisons.
GarryVolchara [31]
In a bubble sort, you use an inner loop to make pair comparisons.
5 0
3 years ago
In order to organize your work effectively on the computer, where is the best place to save it?
Morgarella [4.7K]
Your answer is -

B. Folder Is the best place to save it
8 0
3 years ago
Read 2 more answers
Learning Management Systems (LMS) allow students to interact with each other, but NOT their teachers.
VMariaS [17]

Answer:

what do you mean friend not for teacher

8 0
3 years ago
Read 2 more answers
Other questions:
  • The arrow next to All Programs indicates _____. that this item cannot be selected that this was the most recently used item the
    7·2 answers
  • Behaving in an acceptable manner within a workplace environment is referred to as having
    9·1 answer
  • Peripherals can be used to output information.<br> True<br> False
    9·2 answers
  • The "Rudolph Rule" is best described by which of the following?
    9·1 answer
  • What does it mean to search an index or the web? (DONT TAKE ANSWERS FROM THE INTERNET!)
    9·2 answers
  • How does the Problem-solving Process help us to solve everyday Problems?
    13·1 answer
  • An optical fibre has an attenuation of 0.3 dB/km. If a laser launches an optical power level of PIN (mW) into 35 km length of th
    8·1 answer
  • Do you think people accept poor quality in information technology projects and products in exchange for faster innovation? What
    5·1 answer
  • Write a program that produces an expense report for a trip to Lagos, Nigeria. Use the Internet to research the cost to travel to
    13·1 answer
  • Tommy loves taking care of homing pigeons. He sent a note to his crush who lives 24.0 km away from his house. These birds fly at
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!