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
Which of the following is a safe work practice to protect you from electrocution hazards?
Flura [38]
What are the answer choices?
7 0
3 years ago
Which one of them are the correct answers?
Tpy6a [65]

Rapid prototyping! I am sure that is correct


6 0
3 years ago
A support agent who feels that a user needs substantial assistance with the organization of files on their pc should ____.
Lapatulllka [165]
A support agent who feels that a user needs substantial assistance with the organization of files on their PC should p<span>oint the user to useful information about file organization. 
Given that the user needs substantial assistance, the support agent cannot just simply explain to them what they need to do. He does, however, need to tell them where they can learn about what they need to know.
</span>
6 0
3 years ago
QUESTION 3 Which sequence of events illustrates the most helpful problem-solving plan? o Think of a solution, execute it, and ev
gtnhenbr [62]
Clearly state the problem, analyze its cause and effects, brainstorm possible solutions, evaluate the pros and cons of each potential choice, pick an option, try it out, and evaluate its success.
4 0
3 years ago
To give text an outline, you can use which command?
Sindrei [870]

Answer:

To show all text in an outline. Position the cursor the and then press

Alt + Shift + A

Explanation:

8 0
3 years ago
Other questions:
  • Vpns create a _____________ to transport information through public communications media.
    8·1 answer
  • What is the management part of a dashboard?
    10·1 answer
  • Can someone please help me? I have no clue what any of this is and how I'm going to find out 15 examples of these. It's due some
    5·1 answer
  • Java and Python are considered rapid development programming languages?<br><br> True<br><br> False
    12·2 answers
  • Write a code that makes a 2D square array with 20×20 elements. Fill the array with random numbers initially. Then, "draw" a squa
    9·1 answer
  • 1D Array Assignment Outcome: Student will demonstrate the ability to use a one-dimensional array. Student will demonstrate the a
    5·1 answer
  • Last week, a disk containing CSM Tech Publishing’s current project manuscripts crashed. Fortunately, there was a backup, but all
    15·1 answer
  • How do I get the most points, without any effort?
    11·2 answers
  • Calculate the number of telephone
    5·1 answer
  • The view that perceptual processes take place over time and can be thought of in terms of a software/hardware metaphor is known
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!