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
aleksandr82 [10.1K]
3 years ago
13

Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255

. Thus (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray). Given values for red, green, and blue, remove the gray part.
Ex: If the input is 130 50 130, the output is: 80 0 80

Required:
Find the smallest value, and then subtract it from all three values, thus removing the gray.
Computers and Technology
1 answer:
Effectus [21]3 years ago
8 0

Answer:

<em>The programming language is not stated; However, I'll answer the question using C++ programming language, </em>

<em>This program uses comments for explanations  </em>

<em>Program starts here</em>

#include<iostream>

using namespace std;

int main()

{

//Declare Array

int colorcode[3],graycode[3];

//Prompt user for color code

cout<<"Enter Color Code (One on a line)"<<endl<<"Inout Range is 0 to 255"<<endl;

for(int i = 0;i<3;i++)

{

 ccode:  

 cout<<"Enter Color Code "<<i+1<<": ";

 cin>>colorcode[i];

 if(colorcode[i]<0 || colorcode[i]>255)

 {

  cout<<"Input Range is 0 to 255"<<'\n';

  goto ccode;

 }

}

//Initialize smallest to colorcode[0]

int smallest = colorcode[0];

//Determine smallest

for(int i = 0;i<3;i++)

{

 if(colorcode[i]<smallest)

 {

  smallest = colorcode[i];

 }

}

//Determine Graycode

for(int i = 0;i<3;i++)

{

 graycode[i] = colorcode[i] - smallest;

}

//Display Result:

cout<<"Color Code: "<<"(";

for(int i = 0;i<3;i++)

{

 if(i!=2)

 {

 cout<<colorcode[i]<<",";  

 }

 else

 {

  cout<<colorcode[i]<<")"<<endl;  

 }  

}

cout<<"Gray Code: "<<"(";

for(int i = 0;i<3;i++)

{

 if(i!=2)

 {

 cout<<graycode[i]<<",";  

 }

 else

 {

  cout<<graycode[i]<<")"<<endl;  

 }  

}

return 0;

}

You might be interested in
In this first journal assignment, you will explore the role of testing in the SDLC. You will explain the role and importance of
timama [110]
It is SDLC your welcome good luck
7 0
3 years ago
All conductors,buses,and connections should be considered
SashulF [63]

They should be considered as energized

6 0
4 years ago
Consider the following process for generating binaries. A compiler is used to generate the object code for individual modules, a
Taya2010 [7]

Answer:

The answer of this question is described in the explanation part.

Explanation:

  • The connection operator will substitute unresolved conceptual addresses with the real addresses aligned with either the end system decimal parameters.
  • To do this, the modules should keep records of directives which relate to ambiguous signals.
  • In the relating, each configuration in the application framework binary is assigned a pattern of domain names.
  • This has been done, problematic connections to objects imported by this unit may be substituted in other frameworks because each other system would contain the set of instructions to be repaired for.

7 0
3 years ago
Which tab is used to configure an export to PST in Outlook 2016?
Blizzard [7]

Answer:

file

Explanation:

you should go through the file so as to configure it

3 0
4 years ago
Read 2 more answers
Ex1. Classify the following statements as business (B), functional (F), non- functional (N), or data (D) requirements; for the l
Alina [70]

Answer:

<em>Solution</em>:

The statements are listed below.  

<em>(A) Functional requirement </em>

  • Functional specifications refer to the handling of calls.  
  • Minimum call number should be 3000, and a functional requirement.  

<em>(B) Non-functional requirement</em>

  • Non-functional requirement is the default option.  
  • Payment in "Visa" is required and this is not a functional requirement.

<em>(C) Data requirements</em>

  • Data requirements apply to quantity of order.  
  • When the quantity of data exceeds then an exception should be notified  

<em>(D) Business requirements. </em>

  • Product reviews are subject to business requirements.

3 0
3 years ago
Other questions:
  • PLEASEEEEEEEEEEEEEEEEE HELPPPPPPPP
    15·1 answer
  • Why are agorithms important?
    8·1 answer
  • Why RAM is necessary in a computer​
    9·1 answer
  • There are types of templates​
    5·1 answer
  • Mathematics and modern technology​
    14·1 answer
  • What is binary ????????
    5·2 answers
  • Please tell me which ones go into which categories no files!!
    11·1 answer
  • Explain working principle of computer.​
    5·2 answers
  • I neeed help pleaseeee
    7·1 answer
  • The USGS and National Weather Service have many sensors collecting data about natural events.
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!