subject

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?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
What are two of the most common reasons that peolpe who need mental health care do not access it?
Answers: 1
question
Computers and Technology, 22.06.2019 19:40
Solve the following javafx application: write a javafx application that analyzes a word. the user would type the word in a text field, and the application provides three buttons for the following: - one button, when clicked, displays the length of the word.- another button, when clicked, displays the number of vowels in the word.- another button, when clicked, displays the number of uppercase letters in the word(use the gridpane or hbox and vbox to organize the gui controls).
Answers: 1
question
Computers and Technology, 23.06.2019 16:10
What is the ooh? a. omaha occupation handbook b. online occupational c. occupations online d. occupational outlook handbook select the best answer from the choices provided
Answers: 3
question
Computers and Technology, 24.06.2019 02:20
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
You know the right answer?
Acolor class has a method getcolorname that returns a string corresponding to the common name for th...
Questions
Questions on the website: 13722362