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
Implement a function inValues() that asks the user to input a set of nonzero floating-point values. When the user enters a value
elena-s [515]

Answer:

Explanation:

The following is written in Python and uses exception handling to do exactly as requested. It then goes adding all of the integer values to an array called num_list and finally adding them all together when the function ends.

def in_values():

   num_list = []

   while True:

       try:

           num = input("Input non-zero floating point: ")

           num = int(num)

           if num == 0:

               break

           else:

               num_list.append(num)

       except ValueError:

           print("No valid integer! Please try again ...")

           try:

               num = input("Input non-zero floating point: ")

               num = int(num)

               break

           except ValueError:

               break

   sum = 0

   for number in num_list:

       sum += number

   return sum

5 0
3 years ago
I am a receptionist for a large corporation
Musya8 [376]
Therefore the answer is within yourself
5 0
4 years ago
Which of the following describes the term "false information?"
pav-90 [236]
Inaccurate and misleading
3 0
4 years ago
Given three variables, a, b, c, of type double that have already been declared and initialized, write some code that prints each
Olegator [25]

Answer:

The following code from the C++ programming Language:

cout << setw(10) << setprecision(3) << scientific;

cout << a << " " << b << " " << c;

Explanation:

In the above code, we have three double type variable "a", "b", "c" which already have been declared and initialized.

E-notation is how we write any number that is too small and too large to be in briefly written in decimal format.

6 0
4 years ago
Tom wants to send an image by email to his friend Nadia. He needs to reduce
erica [24]

<u>1</u><u>s</u><u>t</u><u> </u><u>Method:</u>

  • Reduce the size of the image in <u>Paints.</u>

<u>2</u><u>n</u><u>d</u><u> </u><u>Method:</u>

  • Right-click the selected file you want to send.
  • Click on <u>Send To</u> > M<u>ail Recipient</u>.
  • The Send Pictures via E-mail dialog box appears.
  • Click <u>Make all my pictures smaller</u>, and then click OK.

Hope you could understand.

If you have any query, feel free to ask

6 0
3 years ago
Other questions:
  • Which of the following are examples of IT careers? Check all of the boxes that apply.
    12·2 answers
  • . Here is a sequence of addresses during execution of some program: 4, 16, 0, 20, 52, 68, 172, 64 Assuming a fully associative c
    8·1 answer
  • g c 24-hour time (also known in the U.S. as military time) is widely used around the world. Time is expressed as hours since mid
    7·1 answer
  • Prompt the user for a character and the height of a right triangle. Then, print a triangle of that height using the character en
    11·1 answer
  • Who wants to join my zoom after school 23456+4567
    15·1 answer
  • How do you implement instruction level parallelism
    11·1 answer
  • Which button should be utilized if a user is unsure whether or not they are the right person to reply to an email?
    6·2 answers
  • A(n)______is a database object used to customiz
    11·1 answer
  • Guys help me, to get 25 examples of computer software​
    8·1 answer
  • Compare the strengths and limitations of modern computer programming <br> languages.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!