Skip to content
Home
Marketing
Marketing – vCMO
Expertise
Development
Software Development
Salesforce Development
WordPress Plugin Development
Full-Stack Web Development
Automation
Business Coach
About Matthew Maennche
Resources
C++ Solution Map
Java Solution Map
Python Solution Map
Visual Basic Solution Map
FAQ
Contact
Log In
Blog
Learn To Code
1668 Posts
Java
831 Posts
C++
578 Posts
Visual Basic
232 Posts
Python
30 Posts
Business
10 Posts
General
8 Posts
PHP
5 Posts
Web Development
1685 Posts
Classic ASP
4 Posts
Javascript
2 Posts
Content Management
2 Posts
BuddyPress
2 Posts
FPDF
2 Posts
CRM's
1 Post
Microsoft Dynamics CRM
1 Post
Random
1 Post
SQL
1 Post
HTML
1 Post
Uncategorized
1 Post
Search
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.
View Solution
Scroll To Top