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
natta225 [31]
3 years ago
15

Summary: Given integer values for red, green, and blue, subtract the gray from each value. Computers represent color by combinin

g 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. Thus, find the smallest value, and then subtract it from all three values, thus removing the gray.
Engineering
2 answers:
serg [7]3 years ago
6 0

Answer:

Using C++, the program appears as follows

#include <iostream>

using namespace std;

int main() {

int r,g,b,small;

//input values

cin>>r>>g>>b;

//find the smallest value

if(r<g && r<b)

small=r;

else if(g<b)

small=g;

else

small=b;

//subtract smallest of the three values from rgb values hence removing gray

r=r-small;

g=g-small;

b=b-small;

cout<<r<<" "<<g<<" "<<b<<endl;

}

Sindrei [870]3 years ago
5 0

Answer:

Using C++, the program is as follows;

#include <iostream>

using namespace std;

int main() {

int r,g,b,small;

//input values

cin>>r>>g>>b;

//find the smallest value

if(r<g && r<b)

small=r;

else if(g<b)

small=g;

else

small=b;

//subtract smallest of the three values from rgb values hence removing gray

r=r-small;

g=g-small;

b=b-small;

cout<<r<<" "<<g<<" "<<b<<endl;

}

You might be interested in
Car B is traveling a distance dd ahead of car A. Both cars are traveling at 60 ft/s when the driver of B suddenly applies the br
vagabundo [1.1K]

Answer:

Explanation:

Using the kinematics equation v = v_o + a_ct to determine the velocity of car B.

where;

v_o = initial velocity

a_c = constant deceleration

Assuming the constant deceleration is = -12 ft/s^2

Also, the kinematic equation that relates to the distance with the time is:

S = d + v_ot + \dfrac{1}{2}at^2

Then:

v_B = 60-12t

The distance traveled by car B in the given time (t) is expressed as:

S_B = d + 60 t - \dfrac{1}{2}(12t^2)

For car A, the needed time (t) to come to rest is:

v_A = 60 - 18(t-0.75)

Also, the distance traveled by car A in the given time (t) is expressed as:

S_A = 60  * 0.75 +60(t-0.75) -\dfrac{1}{2}*18*(t-0.750)^2

Relating both velocities:

v_B = v_A

60-12t = 60 - 18(t-0.75)

60-12t =73.5 - 18t

60- 73.5 = - 18t+ 12t

-13.5 =-6t

t = 2.25 s

At t = 2.25s, the required minimum distance can be estimated by equating both distances traveled by both cars

i.e.

S_B = S_A

d + 60 t - \dfrac{1}{2}(12t^2) = 60  * 0.75 +60(t-0.75) -\dfrac{1}{2}*18*(t-0.750)^2

d + 60 (2.25) - \dfrac{1}{2}(12*(2.25)^2) = 60  * 0.75 +60((2.25)-0.75) -\dfrac{1}{2}*18*((2.25)-0.750)^2

d + 104.625 = 114.75

d = 114.75 - 104.625

d = 10.125 ft

3 0
3 years ago
Please help me do this with my exam tomorrow.
blagie [28]

Answer:

ddddddddddddddddddddddddddddd

Explanation:

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

6 0
3 years ago
To read signs you need good focal vision
kow [346]

Answer:eyesight

Explanation:

7 0
3 years ago
Read 2 more answers
Carbon nanotubes can be a considered toxic agent due to: (a)- Its ability to produce toxic gases (b)Its ability to penetrate ski
SpyIntel [72]

Answer: b)Its ability to penetrate skin quickly due to its very small diameter

Explanation: Carbon nano tubes(CNT) are the material widely used in the medical field due to the atomic structure of it ans also have small size. Toxicity in the carbon nano tubes is because their small sized atomic particles which can enter the skin by penetration or inhalation. But are still preferred in the medicine because having unique properties like mechanical property, chemical property,surface property etc.

4 0
3 years ago
What affect results when there is an impact between earth and is astroids check all that apply.
Vadim26 [7]

Answer:

Massive destruction

Explanation:

If the asteroid collides with the ground, a massive volume of dust will be blasted into the environment. If it collides with water, the amount of water vapour in the atmosphere will rise. This would result in more rain, which would cause earthquakes and mudslides.

As the asteroid collided with the Earth, massive volumes of dust were ejected into to the atmosphere. The sun's light were stopped from entering the Earth's surface, which is terrible news for plants.

6 0
3 years ago
Other questions:
  • Thermal energy generated by the electrical resistance of a 5-mm-diameter and 4-m-long bare cable is dissipated to the surroundin
    12·1 answer
  • In order to build a skyscraper Builders, Inc. hires 400 construction workers and 50 managers. Builders, Inc. represents A entrep
    8·1 answer
  • A spherical, stainless steel (k 16 W m1 K-1) tank has a wall thickness of 0.2 cm and an inside diameter of 10 cm. The inside sur
    12·1 answer
  • 2.4 kg of nitrogen at an initial state of 285K and 150 kPa is compressed slowly in an isothermal process to a final pressure of
    8·1 answer
  • #198. Moment of inertia about center of a segmented bar A bar of width is formed of three uniform segments with lengths and area
    7·1 answer
  • How long does it take electrons to get from a car battery to the starting motor? Assume the current is 300 A and the electrons t
    10·1 answer
  • You have a 12 volt power source running through a circuit that has 3kΩ of resistance, how many amps (in mA) can flow through the
    15·1 answer
  • 5. Liam is working on a circuit and notices it's quite hot to the touch. What's causing the heat Liam Is noticing
    6·1 answer
  • At the coast on a summer day, the land is hotter than the ocean. Warm air over the land rises and is replaced by cooler air, cau
    14·2 answers
  • Which of the following applies to a module?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!