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
If you’re storing some personal information like Debit/Credit card numbers or Passwords etc, on different sites for running you’
nata0808 [166]

Answer:

cookies are stored on client side.

A hacker would need access to your computer, either by physically reading the cookie data or by means of cross-site scripting.

Other than that, cookies should not contain passwords or credit card numbers, just things like preferences or session identifiers.

3 0
3 years ago
In the belt drive mechanism, what happens when the belt is crossed instead of open?
KengaRu [80]
They will spin in the opposite direction because the belts are twisted.
8 0
3 years ago
A man receives a fraudulent email from his bank asking him to confirm his user name and password by going to a particular websit
bonufazy [111]

Answer: The man's info has been found and a hacker was trying to make him confirm his passwrd so he can get a hold of it to hack the man further.

Explanation:

3 0
3 years ago
Write a program in C++ to swap two variables usingfunctions?
lilavasa [31]

Answer:

#include <iostream>

using namespace std;

void swap(int& m, int& n)  /* passing by reference so that changes will be made in the original values.*/

{

   int t=m;

   m=n;

   n=t;

}

int main()

{

   int val1,val2;

   cout<<"Enter the values"<<endl;

   cin>>val1>>val2;

   cout<<"Values before swap "<<val1<<" "<<val2<<endl;

   swap(val1,val2); //calling the function swap..

   cout<<"Values after swap "<<val1<<" "<<val2<<endl;

return 0;

}

Explanation:

Created a function swap with 2 arguments m and n passed by reference.

8 0
4 years ago
The _____ model of a systems development life cycle provides for progressive development of operational software, with each rele
dimaraw [331]

Answer:

B. Incremental Build life cycle

Explanation:

RAD life cycle: RAD model of software development life cycle is all about coming up with prototype as soon as possible. It describes a method of software development which heavily emphasizes rapid prototyping and iterative delivery.

Incremental build life cycle: In incremental build model of software development life cycle, each release of the software have added capabilities. The development is finished when the user is okay with the present features. Focus is put on creating a working prototype first and adding features in the development life cycle. This is the correct option.

Waterfall life cycle: In a waterfall model, each phase must be completed fully before the next phase can begin and this usually takes time before a working software can be released. There is also no overlapping in the phases.

Spiral life cycle: Spiral Model can be pretty costly to use and doesn't work well for small projects. It's a risk-driven model which means that the overall success of a project highly depends on the risks analysis phase.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Write a setInterval() function that increases the count by 1 and displays the new count in counterElement every 400 milliseconds
    14·1 answer
  • Which event occurs when the user clicks on an html element?
    9·1 answer
  • Define the term unique key and give an example.
    6·1 answer
  • If the mine winch drum diameter is 6M, how far will the counterweight lift for each single rotation of the drum
    11·1 answer
  • How to delete a virus that act by restarting u r computer? I am in safe mood to aviod restart.
    10·1 answer
  • In Access, you use the Save As command to save a copy of your data. True or False
    15·1 answer
  • How many websites are mobile friendly?
    7·1 answer
  • It is impossible to overemphasize the fact that, from the perspective of a computer, a network is a) simply another I/O device.
    9·1 answer
  • Please help i will give you brainlest!!!!!!!!!
    6·1 answer
  • Briefly explain the conceptual of effective computer based instruction for adults outlining the three units output process and i
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!