answer.
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]
2 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]2 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
Explain why each of the following names does or does not seem like a good variable name to represent a state sales tax rate.
tatyana61 [14]

a. stateTaxRate  - A good variable name because it represents what it holds, the state sales tax rate, without being too wordy. Also correctly capitalized in camelcase.

b. txRt  - A bad variable name because while short and simple, it is too hard to understand what the variable represents.

c. t  - A very bad variable name if you plan on using the variable often. Far too short and you will forget what it represents and is needed for.

d. stateSalesTaxRateValue  - A bad variable name because it is just too wordy. Cutting it down to A's variable name is much more reasonable

e. state tax rate  - A bad variable name and probably invalid because it has spaces in the name.

f. taxRate  - A good variable name if there are no other tax calculations other than state tax rate. Otherwise you would confuse state vs local tax rate or something, making it a bad variable name.

g. 1TaxRate  - A bad variable name because the number 1 has no reason being in the variable name. It doesn't add anything to the name.

h. moneyCharged - A bad variable name because it is not specific enough in explaining why the money is being charged and what for.

7 0
2 years ago
given the numerical value 1010101.11, which of the following number systems is most likely represented.
nasty-shy [4]

Answer:

u have to give me more points

Explanation:

sorry

7 0
1 year ago
A large software development company employs 100 computer programmers. Of them, 45 areproficient in Java, 30 in C, 20 in Python,
melisa1 [442]

Answer:

18, 13, 19

Explanation:

Number of computer programmers proficient only in Java = 45 - ( 1+1+6) = 37

Number of computer programmers proficient only in C++ = 30 - (6+1+5) = 18

Number of computer programmers proficient only in python = 20 - ( 1+1+5) = 13

Number of computer programmers are not proficient in any of these three languages = 100 - ( 37 + 18 + 13 + 1+ 1+ 5+ 6 ) = 100 - 81 = 19

4 0
1 year ago
At age 16, Cheyenne just got her driver's license. She loves to drive and is thinking of becoming a truck driver, because she he
Ivenika [448]
<span> the answer would be: Does she have or can she develop the strengths needed for this type of work?</span><span />
6 0
1 year ago
Read 2 more answers
What is the value of the variable named myNum after the statements that follow are executed? var myNum = 14; var yourNum = 4; my
Lostsunrise [7]

Answer:

45

Explanation:

Initially, myNum is equal to 14 and yourNum is equal to 4

Then, myNum is incremented by 1 and becomes 15

Also, yourNum is decremented by 1 and becomes 3

Finally, myNum is set to myNum x yourNum, 15 x 3 = 45

8 0
2 years ago
Other questions:
  • An automobile battery, when connected to a car radio, provides 12.5 V to the radio. When connected to a set of headlights, it pr
    11·1 answer
  • Computer hardware without software is useless while computer software without hardware is meaningless. Discuss. Plz provide exam
    15·1 answer
  • Which option describes wearable technology? A. the incorporation of technology into objects we use regularly B. rugged technolog
    8·1 answer
  • In its simplest form, communication is defined as ________.
    7·1 answer
  • Peter accumulated many photos from his visit to Wisconsin. He wants to upload these photos to a social networking site. Which fi
    12·1 answer
  • Given an integer variable strawsOnCamel, write a statement that uses the auto-increment operator to increase the value of that v
    12·1 answer
  • Write the definition of a function named averager that receives a double parameter and return-- as a double -- the average value
    12·1 answer
  • (1) Output a menu of automotive services and the corresponding cost of each service. (2 pts) Ex: Davy's auto shop services Oil c
    15·1 answer
  • 6.4 Predicting Prices of Used Cars. The file ToyotaCorolla.csv contains data on used cars (Toyota Corolla) on sale during late s
    5·1 answer
  • A police department wants to maintain a database of up to 1800 license-plate numbers of people who receive frequent tickets so t
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!