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
Which one of these is not an area of AI? Computer vision/image, recognition Voice recognition, Robotics, Web design
Verdich [7]

Answer:

Computer vision/image

6 0
3 years ago
Read 2 more answers
A(n) _____ is a flexible tool used to analyze data using reports that do not have a predetermined format.
Mandarinka [93]

Answer:

decision support system

Explanation:

4 0
2 years ago
Are Microsoft an Apple more secure from malicious action because of their closed-source approach?
omeli [17]

Yes Microsoft and Apple used the closed-source approach to better secure from malware and make to make their operating systems more user friendly.

7 0
3 years ago
Hymter. Wants to workin The Energy career field with electrical energy
m_a_m_a [10]

Answer: what is the question

Explanation:

3 0
3 years ago
Moore’s law describes the pace at which ______ improve.
iren2701 [21]

Answer: CPUs

Hope it helps :) and let me know if you want me to elaborate.

7 0
3 years ago
Other questions:
  • Java - Given a String variable response that has already been declared, write some code that repeatedly reads a value from stand
    12·1 answer
  • Using Matlab programming I need to rotate the line defined by x,y by 45 degrees around 2,2
    13·1 answer
  • Why is UDP less reliable than TCP?
    9·2 answers
  • Create a class named CarRental that contains fields that hold a renter's name, zip code, size of the car rented, daily rental fe
    13·1 answer
  • Should organizations fear websites where consumers post negative messages about products or services? What actions can companies
    12·1 answer
  • 1. The global economy involves trading between people from different _____
    8·1 answer
  • What is the name of a button on a website?
    11·1 answer
  • Word can store a maximum of how many documents in its Recent Documents area? five ten fifteen twenty
    8·1 answer
  • Why bootable installer preparation is important? explain
    9·1 answer
  • Write a program in C/C++ to draw the following points: (0.0,0.0), (20.0,0.0), (20.0,20.0), (0.0,20.0) and (10.0,25.0). For this
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!