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
This program finds the sum and average of three numbers. What are the proper codes for Lines a and b?
Gennadij [26K]

Answer:

The Proper codes in Line a and Line b is given below

average=Sum/3  

print (" Average is = ", average)

Explanation:

In the given question it calculated the sum but the program does not calculate the average of the 3 numbers.The average of the 3 number is calculated by using average=Sum/3   statement so we add this code in Line a then After that print the value of average by using the print function so we add this code in Line b.

4 0
2 years ago
Read 2 more answers
Which features should a study schedule include? Check all that apply.
Ivenika [448]

Answer: time of day, duration, due dates

Explanation: I am awsome

7 0
2 years ago
Read 2 more answers
Define a function ComputeGasVolume that returns the volume of a gas given parameters pressure, temperature, and moles. Use the g
lara [203]

Answer:

double ComputeGasVolume(double pressure, double temperature, double moles){

   double volume = moles*GAS_CONST*temperature/pressure;

    return volume;        

}

Explanation:

You may insert this function just before your main function.

Create a function called ComputeGasVolume that takes three parameters, pressure, temperature, and moles

Using the given formula, PV = nRT, calculate the volume (V = nRT/P), and return it.

6 0
2 years ago
5.11 Of these two types of programs:a. I/O-boundb. CPU-boundwhich is more likely to have voluntary context switches, and which i
Leno4ka [110]

Answer:

The answer is "both voluntary and non-voluntary context switch".

Explanation:

The description to this question can be described as follows:

Whenever processing requires resource for participant contextual switch, it is used if it is more in the situation of I/O tied. In which semi-voluntary background change can be used when time slice ends or even when processes of greater priority enter.

  • In option a, It requires voluntary context switches in I /O bound.
  • In option b, it requires a non-voluntary context switch for CPU bound.
7 0
2 years ago
Find and record a set of instructions containing a repetition clause (e.g., instructions on a shampoo bottle, a recipe, etc.). H
Leto [7]

This question belongs to scratch programming. This programming language has various instructions to carry out various tasks. There are different types of repeat statement available. This statement or instruction allows the user / programmer to repeat certain line of statements to a number of times. Here, according to the question, we need to use “Repeat after me”

If you take a music note, the tempo, timing and pitch needs to be mentioned clearly and “:” represents that a particular note to be repeated only once.

3 0
2 years ago
Other questions:
  • Import java.util.scanner; public class sumofmax { public double findmax(double num1, double num2) { double maxval; // note: if-e
    10·1 answer
  • Which is true of case-based reasoning (CBR)?
    6·1 answer
  • Suppose a computer using direct mapped cache has 220 bytes of byte-addressable main memory, and a cache of 32 blocks, where each
    5·1 answer
  • Carmina wants to move a paragraph to the right margin of the document she is working in. She moves her cursor to
    8·2 answers
  • Write a program that replaces words in a sentence. The input begins with word replacement pairs (original and replacement). The
    11·1 answer
  • Create the strAnalysis() function that takes 1 string argument and returns a string message. The message will be an analysis of
    15·1 answer
  • What types of messages flow across an SDN controller’s northbound and southbound APIs? Who is the recipient of these messages se
    15·1 answer
  • 5.6 Look carefully at how messages and mailboxes are represented in the email system that you use. Model the object classes that
    14·1 answer
  • Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed
    13·1 answer
  • Select the correct answer. Andy wants to become a multimedia producer. Which degree can help him achieve this goal? A. bachelor’
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!