Computers and Technology
Computers and Technology, 17.12.2019 18:31, mistymjoy

Acolor 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. i have the code for the alphachannelcolor class: public class alphachannelcolor extends color{ @override 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; }}what would the code look like for the color class?

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:50, brianna4455
Which of the following had the greatest influence on opening the internet to the generly public
Answers: 1
image
Computers and Technology, 22.06.2019 08:00, Leggett8152
What best describes a career pathway in a lodging career? a worker starts out as an amusement attendant, then becomes a recreation worker, and then becomes a gaming worker within five years. a worker starts out as a bell hop, then becomes a night clerk, and then becomes a hotel manager within five years. a worker starting out as a tour guide, then becomes a travel clerk, and then becomes a travel agent within five years. a worker starts out as a server, then becomes a food preparer, and then becomes a head chef within five years.
Answers: 1
image
Computers and Technology, 22.06.2019 23:00, nicog94
In which part of a professional email should you try to be brief, but highly descriptive?
Answers: 1
image
Computers and Technology, 23.06.2019 19:30, bevanscory123
What are loans to a company or government for a set amount of time
Answers: 1
Do you know the correct answer?
Acolor class has a method getcolorname that returns a string corresponding to the common name for th...

Questions in other subjects: