Given integer values for red, green, and blue, subtract the gray from each value.

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.

Answers

Answer 1

Answer:

Here is the C++ program:

#include <iostream>   //to use input output functions

using namespace std;   //to identify objects cin cout

int main() {   //start of main method

int red,green,blue,smallest;   //declare variables to store integer values of red,green, blue and to store the smallest value

cout<<"Enter value for red: ";  //prompts user to enter value for red

cin>>red;  //reads value for red from user

cout<<"Enter value for green: ";  //prompts user to enter value for green

cin>>green;  //reads value for green from user

cout<<"Enter value for blue: "; //prompts user to enter value for blue

cin>>blue;   //reads value for blue from user

//computes the smallest value

if(red<green && red<blue) //if red value is less than green and blue values

smallest=red;   //red is the smallest so assign value of red to smallest

else if(green<blue)   //if green value is less than blue value

smallest=green;   //green is the smallest so assign value of green to smallest

else  //this means blue is the smallest

smallest=blue;  //assign value of blue to smallest

//removes gray part by subtracting smallest from rgb

red=red-smallest;  //subtract smallest from red

green=green-smallest;  //subtract smallest from green

blue=blue-smallest;  //subtract smallest from blue

cout<<"red after removing gray part: "<<red<<endl;  //displays amount of red after removing gray

cout<<"green after removing gray part: "<<green<<endl;  //displays amount of green after removing gray

cout<<"blue after removing gray part: "<<blue<<endl;  } //displays amount of blue after removing gray

Explanation:

I will explain the program using an example.

Lets say user enter 130 as value for red, 50 for green and 130 for blue. Sp

red = 130

green = 50

blue = 130

First if condition if(red<green && red<blue)   checks if value of red is less than green and blue. Since red=130 so this condition evaluate to false and the program moves to the else if part else if(green<blue)  which checks if green is less than blue. This condition evaluates to true as green=50 and blue = 130 so green is less than blue. Hence the body of this else if executes which has the statement: smallest=green;  so the smallest it set to green value.

smallest = 50

Now the statement: red=red-smallest;  becomes:

red = 130 - 50

red = 80

the statement:  green=green-smallest;  becomes:

green = 50 - 50

green = 0

the statement: blue=blue-smallest; becomes:

blue = 130 - 50

blue = 80

So the output of the entire program is:

red after removing gray part: 80                                                                                                 green after removing gray part: 0                                                                                                blue after removing gray part: 80

The screenshot of the program along with its output is attached.

Given Integer Values For Red, Green, And Blue, Subtract The Gray From Each Value.Computers Represent

Related Questions

does anyone know what type of Honda this is and the year of it lol this isn’t school related

Answers

my car guy boyfriend said that he thinks its a van due to the space and its definitely a newer Honda but not sure what year. he said don't quote him on it  tho lol

what type of things can be marketed

Answers

Answer:

Physical goods that can be manufactured, or produced are the major items among those can be marketed. Examples include refrigerators, computers, music systems, food products, etc. Such physical goods constitute the bulk of production and marketing efforts. And here are the types of marketing Traditional Marketing. Traditional marketing refers to brand promotion on any kind of channel that has been around since before the advent of the internet.

Why does a bus topology require a terminator

Answers

Answer:The purpose of the terminator is to absorb signals so that they do not reflect back down the line

Explanation:

The answer is-

B.) because otherwise the packets will bounce back and forth from end to end repeatedly

Bus topology can be regarded as a kind of topology for a Local Area Network, it is one that has it's nodes connected to a single cable(backbone) and any break in the so called backbone, there will be failure in the entire segment. However a Terminator is usually attached to the end-points of a bus network so that the signal is absorbed by the Terminator and as a result of this the signal will not reflect back down the line. If there is no Terminator there would be bouncing back and forth of packet in an endless loop.It should be noted that a bus topology require a terminator because otherwise the packets will bounce back and forth from end to end repeatedly

Fill in the blank to give the result of each operation.
2 * 5 =

4 ** 3 =

7 / 2 =

17 % 3 =

Answers

Answer:

2 * 5 =10

4 ** 3 =64

7 / 2 =3.5

17 % 3 =2

Explanation:

I just got them all correct :) good luck

The result from each operation from each operation of the mathematical calculations are 10, 64, 3.5, and 0.51.

What is the mathematical calculations?

Counting, calculating, and grouping objects in simple math information and commercial activities were among the mathematical calculations. Simple math facts and operations can be counted and computed using this formula.

The correct fill in the blanks are:

2 × 5 = 104 ** 3 = 64 (Cube of 4)7 / 2 = 3.517 % 3 =0.51

Therefore, the mathematical calculations made the calculations easier, and it is a time saver.

Learn more about the mathematical calculations, refer to:

https://brainly.com/question/11790473

#SPJ2

I need to finish this assignment today. please help me!

Define: State your Goal What personal value would you like to share with the world?

what does this mean? I don't understand what a personal value is.​

Answers

Answer:

persanal value is the goal

Explanation:

mine would be:

less polution, the value is the goal

5
Select the correct answer.
Which method is used to transfer information from one computer to another?
O A.
mass communication
B.
point-to-point communication
C.
internet protocol
D.
hard disk
E.
microprocessor

Answers

Answer:

A

Explanation:

If you wanted to mass communication means it imparts and exchanges information on a scale of people so you couple transfer and share your data from one person to another.

Answer: A

Explanation:

Plz plz plz help QUICKLY idk the answer and I really need help

Answers

Answer:

productivity is the correct answer

what is computer?write feature of computer​

Answers

Answer:

An electronic device for storing and processing data, typically in binary form, according to instructions given to it in a variable program is computer.

And it's feature are:

Multitasking.Accurate & Speed.Efficient.Reliability.Recoverability

what is a computer?.

a computer is a electronic device that works under the control of information stored in its memory.

features of a computer

multitasking.

8. It is a computer component that converts AC power to DC power to be used
by the computer system.

Answers

Answer:

power supply unit.

A power supply unit (PSU) converts mains AC to low-voltage regulated DC power for the internal components of a computer. Modern personal computers universally use switched-mode power supplies.

Explanation:

I HOPE THIS HELPS

PLZ MARK ME AS BRAINLIEST

THANK U!

Which graphic file format would you choose if you needed to make an animated graphic for a website?

ai

png

gif

py
please help

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct option for this question is gif.

Gif is a series of images that are used as animated graphics for a website. A gif is the file format of an animated image. You may have seen many animated images on websites like stickers etc.

other options are not correct because:

ai: is adobe illustrator file format

png: png is an image file format but not for an animated image

py: py is a file extension of the python file.

Answer:

gif

Explanation:

The collection of tools and features at the top of the screen is called the
O file
O ribbon
O tab

Answers

TAB THE ANSWER IS TAB

When was JavaScript founded?
Write in this format:
mm/yy

Answers

Answer:

It was founded in 09/95

Explanation:

Answer: 09/1995

JavaScript was founded in the September of 1995, in early fall. It is a very common dynamic computer programming language.

I wrote the answer in mm/yy format, so this answer should meet the requirements.

Hope this helps! Best of Luck!

Select the correct answer.
In what decade did the first computer become commercially available?
A.
1950s
B.
1960s
1970s
thing
D.
1980s
O E.
1990s

Answers

Answer:

1960's

Explanation:

Answer: 1960

Explanation:

how can parents be health educators in family​

Answers

Answer:

They can be health educators in family because they are your parents.

Explanation:

The reason why is because since they are your parents that means they have kids, so they probably know the ins and outs of parenting and running a family.

Write a program that will add up the series of numbers: 99,98, 97...3.2.1. The program should print the running total as well as the total at the end.
The program should use one for loop, the range() function and one print() command.
Sample Run
99
197
294
390
-
4940
4944
4947
4949
4950

Answers

Answer:

result = 0

for i in range(99, 0, -1):

   result += i

   print(result)

Explanation:

It gives back a series of numbers that begin at zero, increase by one by default, and end just before the specified number. There are three criteria total, and two of them are optional.

What range() function and one print() command?

For the range() method to produce the integers in reverse order, use a negative step value. For instance, the expression range(5, -,1, -1) will result in the integers 5, 4, 3, 2, and 1.

By setting the step argument of a range() function to -1, you may effectively reverse a loop. Reverse iteration of the for loop's iterations will result.

The range() function returns a series of numbers that, by default, starts at 0 and increments by 1 before stopping in a given number.

Therefore, Instead of being a physical hardware device, a software calculator is one that has been implemented as a computer program.

Learn more about function here:

https://brainly.com/question/18065955

#SPJ5

Which utility causes the computer to run slow? defragmentation utility OR compression utility?

Answers

Answer:

compression

Explanation:

What is the dependent variable, After learning about electricity, a student wants to see if electricity flows better through different materials. Our wonderful student has different materials: copper wire, aluminum wire, carbon fiber, and gold wire. The student attaches a small lightbulb to a 9 volt battery, and uses each wire to see how bright the lightbulb lights up when connected to each material.

Answers

Answer:

The Lightbulb is the dependent variable.

Explanation:

The dependent variable is defined as the variable that the researcher is measuring or testing and it observes the direct effect/change brought by manipulation in the independent variable. In the given experiment, the lightbulb would be characterized as the dependent variable as it is being tested by the researcher. He controls the independent variable(by using different wires) to observe its direct impact on the way the lightbulb lits. Thus, it(lightbulb) is the dependent variable.

idk just anwser this and get get some points lol

Answers

Answer:

ok thxxxxx :)

Explanation:

Answer:

thank you

Explanation:

A company hires Brandon, a software engineer. Brandon is asked to work on a project with others in order to meet a tight deadline. He finds himself in weekly meetings to discuss the direction and status of the project, but most of his time is spent creating code. What is Brandon's specialization?

system management
system support
system collaboration
system development

Answers

Answer:

System developement

Explanation:

he is creating code, which is devloping the system.

Y’all know any movie sites I can go on?

Answers

Answer:

Tinseltown

Explanation:

Give me 2 examples of Monthly Cash Inflow: (2 points) *

Answers

Answer:

cash payments for goods and services; merchandise; wages; interest; taxes; supplies and others.

Explanation:

Answer:

1. Key cash flow drivers should be modeled explicitly.

In our example, a retail store business should start with the number of stores it plans to operate each month, then build up from there, based on the number of square feet and sales per square foot.  This will help the business to compute its revenue.

2. Inputs should only need to be input once.

It is important to group all inputs in the assumptions section so users can easily find, add, and modify them.

Explanation:

(02.05 LC) What is an example of a web browser? Bing Firefox Instagram Yahoo

Answers

Answer: Firefox

Explanation:

Bing and Yahoo are search engines. Instagram is an example of social media. Firefox is a wed browser. A web browser is a window that allows you to open up new tabs. the other three are examples of tabs you can open with Firefox.

Answer:

firefox

Explanation:

How can I crack a computer password?

Answers

Try to use easy passwords first like the persons birthday fav color etc then move on to harder passwords

does anyone have a pdf of the greatest by eddie van der meer????

Answers

Answer

aight' so im finding it but i have to asnwer before someone else so look in the comments for it.

Explanation:

Just wait i getting it rn

Use the drop-down menu to complete the steps for using the Autofill feature. Click the . Click the . Drag the to the desired range. Click the Autofill option you want to use.

Answers

Answer:

Cell,fill handle,fill handle

Explanation:

Trust

Answer:

Guy up top is correct, it's Cell, Fill handle, Fill handle, in that order

Explanation:

the way information from my computer is given back to the user is called​

Answers

Answer:

Add answer???

Explanation:

Which of the following is NOT a characteristic developed by New Journalism?
illustrations and photographs
flashy page layouts
satirical news stories
banner headlines

Answers

Flashy page layouts

The one that is not a characteristic developed by New Journalism is flashy page layouts. The correct option is b.

What are flashy page layouts?

The flashy page Layout describes how the document pages will appear after printing. When we check the layout in Word, we can see that the page layout includes components such as margins, column count, and the ability to alter the header and footer.

There are various sorts of layouts, such as magazine layouts, static, adaptable, dynamic, adaptive layouts, and responsive layouts.

The features are as follows:

Page margin dimensions.Image and figure size and placementColumn and gutter count and size (gaps between columns)Intentional white space placement

Therefore, the correct option is b, flashy page layouts.

To learn more about flashy page layouts, refer to the link:

https://brainly.com/question/28702177

#SPJ2

i really need help please im about to give up

Answers

Answer:

true

Explanation:

because I ain't stupid

n what sense is it now possible for a country to be ""occupied"" by an invisible invader that arrives through airwaves and wireless networks? A. It is almost impossible to block foreign countries’ satellite broadcasts and Internet transmissions. B. Spy satellites and other communications technology are increasingly advanced. C. Global positioning systems have allowed detailed mapping of previously inaccessible places. D. The U.S. government can eavesdrop on almost any form of modern communication.

Answers

Answer:

Option A. is correct

Explanation:

It now not possible for a country to be "occupied" by an invisible invader that arrives through airwaves and wireless networks. It is almost impossible to block foreign countries’ satellite broadcasts and Internet transmissions inspite of Spy satellites and other communications technology and Global positioning systems.

Option A. is correct

Fred is interested in creating marketing materials for video games. Which of the following occupations should he pursue?


texture artist

video game designer

graphic artist

video game artist

Answers

Answer:

The answer above is wrong well at least for odyssey ware!!

Explanation:

I think D

Other Questions
Jamall has 20 mo of planes and cars. He has three times as many cars in points. What is the Find the slope between the points.(4, -6) and (-2, 1) 15 POINTS ! Act 1 The crucibleWhat does Proctor have againstParris?What does Parris have againstProctor?What does Putnam have againstProctor?What does Proctor have againstPutnam?What does Putnam have againstParris? translate R_____ _s __t___gen__ Which African American civil rights organization, formed in 1909, used legal means and the courts to fightsegregation?O the SCLCO the NAACPO the Nation of IslamO the Little Rock Nine Suppose that the plasma membrane around a eukaryotic flagellum is opened to reveal the axoneme inside. The dynein arms between the peripheral microtubule doublets are removed by chemical treatment, and adenosine triphosphate (ATP) is added. Which of these would be the most expected observation? You can multiply -2.2 by 6.2 to find the total variation in water level. What decimal represents the total variation in water level that Ericka observed? simplify. write your answer in standard form. -4-8x+2x-15 Which statements about energy are true?1.Energy is found only in moving objects.2.Energy is never created.3.Energy can move matter.4.Energy is the same as force.5.Energy is never destroyed Female killer whales can live for ____ years or more. 50 80 30 60PLEASE HELP I need help because I dont understand that question plsss help I'm confused fast Please help me the picture is above Ill mark you as the brainliest but please show the work. Thank you! :) What is symbolic interactionist on gender? Explain Juveniles who are tried and convicted as adults areunable to appeal their convictions.ineligible for life sentences or the death penalty.temporarily held in a youth detention center.sent to prison regardless of their age. how do you multiply powers that have the same base What is the equation of the line that is parallel to the line 5x + 2y = 12 and passes through the point (-2, 4)?o y = -xx-1y=-{x+5O y = 2 x 1y=x+5 Write each number in scientific notation.160,000,000 29,8300.000350Please answer asap!!Thank you HELP QUICK PLEASE!!!Which pairs of quadrilaterals can be shown to be congruent using rigid motions?Select Congruent or Not Congruent for each pair of quadrilaterals. Congruent Not Congruentquadrilateral 1 and quadrilateral 2 quadrilateral 1 and quadrilateral 2 quadrilateral 1 and quadrilateral 2quadrilateral 1 and quadrilateral 3 quadrilateral 1 and quadrilateral 3 quadrilateral 1 and quadrilateral 3quadrilateral 1 and quadrilateral 4 quadrilateral 1 and quadrilateral 4 quadrilateral 1 and quadrilateral 4quadrilateral 2 and quadrilateral 3 quadrilateral 2 and quadrilateral 3 quadrilateral 2 and quadrilateral 3quadrilateral 2 and quadrilateral 4 quadrilateral 2 and quadrilateral 4 quadrilateral 2 and quadrilateral 4quadrilateral 3 and quadrilateral 4 y=50(3)^20please please please answer soon 20 points