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

i need help with this fast, thank you sm if you help me. ill give you brainliest

Answers

Answer:

Red

Explanation:

Magsulat ng ilang mga paalala sa paggawa ng proyektong Series Circuit
1._______________________________________________

2.______________________________________________

3.______________________________________________

4.______________________________________________

5.______________________________________________

PLEASE HELP ME​

Answers

Answer:

mag ingat,dapat d basa ang kamay,ayusin ang posive at negative na hindi maghalo,kong may electric tape mas safe..

Explanation:

yun yung tips ko kasi nakagawa na kami non ay yop 1 yung samin

The implementation stage of the SDLC _____.


involves describing the desired functionality of the system


involves establishing an overview of the project goals


involves putting the system into production so users can begin to perform real business operations with the system


involves analyzing end-user business requirements in order to refine project goals

Answers

Answer:

d. involves analyzing end-user business requirements in order to refine project goals

Explanation:

In the software development life cycle, the implementation stage is the stage where the computer programmers begin the actual coding of the application required by the end-user. At this stage, the developer takes into account the needs and specifications of the customer.

For example, if the end-user wants a software application that can track payment records, the researcher at this stage begins using the right software to code programs that can effect this function.

Describe in 2-4 sentences how you would select a function on a spreadsheet.

Answers

Answer:

Explanation:

You would call the capacity from the primary. At that point execute your own factors to it. When the capacity is in the cell, you can copy and after that paste it into another cell to do a similar capacity for that diverse scope of cells.

You would call the capacity from the primary. At that point execute your own factors to it. When the capacity is in the cell, you can copy and after that paste it into another cell to do a similar capacity for that diverse scope of cells.

What is spreadsheet?

A spreadsheet is a type of computer program used for organizing, calculating, analyzing, and storing data in tabular form. Spreadsheets were created as digital counterparts to traditional paper accounting spreadsheets.

The data entered into a table's cells is what the program uses to run. Each cell may include text, numeric data, or formula results that automatically calculate and display values based on the contents of neighboring cells.

Users of spreadsheets can change any stored value and watch the changes in calculated values. This enables quick investigation of numerous scenarios without the need for manual recalculation, making the spreadsheet helpful for "what-if" study.

Therefore, You would call the capacity from the primary. At that point execute your own factors to it. When the capacity is in the cell, you can copy and after that paste it into another cell to do a similar capacity for that diverse scope of cells.

To learn more about Spreadsheet, refer to the link:

https://brainly.com/question/8284022

#SPJ3

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:

i really need help please im about to give up

Answers

Answer:

true

Explanation:

because I ain't stupid

(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:

Choose the best answer to complete the sentence.

A transferable skill can be applied:

in a variety of situations and roles.

in only one setting or situation.

in every situation.​

Answers

Answer:

First is A

Explanation:

Second is B,C,F

Look both _____before you cross a street and i want to see how much of yall know it

Answers

Answer:

Ways

Explanation:

Look both ways

The
is an interest inventory that classifies people according to six different types: Realistic, Investigative, Artistic, Social, Enterprising, and Conventional.


is an aptitude assessment that matches students with study programs at specific colleges and universities.

Answers

Answer:

Campbell Interest Inventory , FOCUS2

Explanation:

Answer:

Campbell Interest Inventory , FOCUS2

Explanation: I took the test and made 100

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:

Joann now wants to create a building block for the name of her company. She outlines the steps she needs to take to access the Create New Building Block dialog box. What does Joann need to change in her outline? Check all that apply.

Answers

Answer: D. She needs to revise step 4

Explanation: Just took the assignment on edge.

Answer:

D. She needs to revise Step 4

Explanation:

Edge 2020

Which note-taking method quickly captures and organizes information?

mapping
Cornell
SQRW
recording

Answers

Answer:

c mapping

Explanation:

Mapping  is a note-taking method that quickly captures and organizes information

What is mapping method in note-taking?

Mapping is known to be s process where one can make use of their comprehension or concentration skills and then they can use in a note taking form.

In this method, it always linked each fact or idea to all other fact or idea. Mapping is known to be a kind of  graphic representation of the work or all the contents of a lecture.

Learn more about mapping  from

https://brainly.com/question/1425367

Can a syntax error occur in a block-based code? Why or why not?

Answers

The environment stops two instructions from snapping together if they cannot be combined to form a valid assertion. Via preventing syntax problems in this way, block-based programming environments maintain the practice of writing programs by piecemeal assembly of statements.

Why do syntax errors happen?

When a programmer enters an incorrect line of code, they have made a syntax error. Missing punctuation or misspelled names are the two most common syntax mistakes. In either a compiled or an interpreted programming language, a syntax error prevents the code from running.

The source code contains a syntax error, but the object code does not. A source program is created by a programmer using a word processor or editor and written in high level language.

To learn more about Syntax error refer to:

https://brainly.com/question/24822807

#SPJ1

The ____ logic unit is responsible for the execution of arithmetic and logical operations.

Answers

Answer:

The arithmetic/logic unit(ALU)

Explanation:

This unit executes all arithmetic and logical operations through the electrical circuitry it has.

Myra Wrote a Program and forgot to put the steps in the correct order. Which step does Mya need to Review

A. Pattern Following
B. Planning
C. Segmenting
D. Sequencing

Answers

Answer:

B. Sequencing

Explanation:

I hope this helps you UwU

Answer:

The answer is 'A'

Explanation:

I took the test, and got a 100%

It also makes more sense than the other choices.

Have a good day <3

Create a bash shell script for a number guessing game. Here are the requirements: a. Your program generates a random number between 0 and 128 and keeps asking the user to guess the number until the user guesses it correctly. b. If the user guesses a number that is lower or higher than the number to be guessed then indicate that information to the user as a ‘low guess’ or a ‘high guess’ so that the user can get to the correct guess quicker. c. The program keeps track on number of guesses taken by the user to get to the correct guess. This is user’s score. d. Your program asks user for the name and adds user’s name and the score in a file that keeps track of the scores by various users. e. At the end of the game, the program displays the top 3 scores (lowest 3 scores) along with the name of the users to conclude the game. John 4 Sam 7 Tony 10

Answers

Answer:

Here is the bash shell script:

scorefile="scores_bash"

guess=-1

typeset -i n=0

echo -e "guess.bash - Guess a number between 0 to 128\n"

(( answer = RANDOM % 128 + 0 ))

while (( guess != answer )); do

n=n+1

read -p "Enter guess $n: " guess

if (( guess < answer )); then

 echo "Low guesss"

elif (( guess > answer )); then

 echo "High guess"

fi

done

echo -e "You guessed the number in $n guesses.\n"

read -p "Enter your name: " name

echo $n $name >> $scorefile

echo -e "\nScores"  

sort -n $scorefile

Explanation:

The program creates a scorefile as scores_bash to store the names and scores. Next the program initializes the guess with -1. guess is used to store the guess made by user and n is used to store the number of trials user took to guess the correct number. Next the program prompts the user to: Guess a number between 0 to 128 and generates random numbers from 0 to 128 and store it into answer.  Next the while loop keeps repeating until the user guesses the correct number. If the user guess is less than the correct answer then the program displays the message Low guess otherwise displays High guess. When the user guesses the correct number, the loop breaks and the message You guessed the number in $n guesses. is displayed where in place of $n the number of trials user take to guess the number is displayed. Next the user is asked to enter his name.

echo $n $name >> $scorefile statement adds the n which is the user score and name which is the names of user to the score file.  sort -n $scorefile  sorts the file in ascending order to display the lowest  scores. The screenshot of program with its output is attached.

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:

What are the two reasons we analyze algorithms?

Answers

Answer:

the most straightforward reason for analyzing an algorithm is too discover its characteristics in order to evaluate its suitability for various applications or compare it with other algorithms for the same application

What era did the television occurred in

Answers

Answer:

roughly from the late 1940s through the late 1950s.

Explanation: hope this helps :)

Answer:

The first Golden Age of Television is the era of live television production in the United States, roughly from the late 1940s through the late 1950s.

Explanation:

Someone copied a library video and sold the copies to friends. This is an
example of

Answers

Answer:

Intellectual Property Theft.

Explanation:

Intellectual property theft involves robbing people or companies of their ideas, inventions, and creative expressions—known as “intellectual property”—which can include everything from trade secrets and proprietary products and parts to movies, music, and software.

Answer:

cybercrime

both employees and outsiders

Aimless wandering

A security guard

Many security breaches ........

intellectual property theft

stealing ideas, information, or creative products

add a watermark

embezzling

-
Which of the following is an example of academic integrity?
A. You work on each assignment mostly by yourself
B. You don't copy work or allow others to copy your work
c. You look up answers on the internet without citing the source
D. You work with close friends on assignments without instructor approval

Answers

Answer:

B. You don't copy work or allow others to copy your work

Explanation:

The example of academic integrity is that you don't copy work or allow others to copy your work. The correct option is B.

What is academic integrity?

The moral code or ethical policy of academics is known as academic integrity. The R.C., regarded as the "grandfather of academic integrity," popularised the phrase.

Being honest, fair, polite, and responsible in your studies and academic work is referred to as having academic integrity.

It entails acting in accordance with these ideals both when producing your own work and engaging with that of others.

Academic integrity is the practise of doing learning, teaching, and research with the principles of honesty, trust, fairness, respect, and responsibility.

Students, teachers, researchers, and all other staff members should act honestly, take responsibility for their choices, and be fair in all aspects of their job.

Thus, the correct option is B.

For more details regarding academic integrity, visit:

https://brainly.com/question/9540934

#SPJ2

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.

A student opens a recently purchased software package and begins reading the enclosed materials. What information might be included in the software license? Check all that apply.

Answers

Answer:

1,2,4

Explanation:

plss give me brainliest

Answer:1,3,4

Explanation:just did it

What are some consequences of posting inappropriate material online? (Choose all that apply)
friends and loved ones might think less of you
you might land in legal trouble
your social media history will be erased from the internet
future employers may not want to hire you.

Answers

Answer:

I think all of them is a consequence of posting inappropriate material online

All except the third one unless it’s something really bad. But otherwise it’s without the third one

In one to two sentences, describe how to create a new tab.

Answers

Answer:

First you could move your cursor to the right and click on the button that looks like this +    

Or you can press ctrl+T and make a new tab

Explanation:

Hope this help you!

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

Answers

Answer:

Add answer???

Explanation:

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

Answers

Answer:

productivity is the correct answer

Which of the following are examples of packages you can import and use classes from in java?

Choose all options that apply.


A. Main.main

B. java.util

C. java.double

D. java.int

E. edhesive.shapes

Answers

it’s D java. int i think

Introduction:

Java is a computer programming language. A computer programmer may use package in java which is a mechanism to encapsulate a group of classes and then import it to sub package interfaces.

Explanation:

These package help to prevent the issues of naming conflicts. The examples of packages which can import and use classes from in java are

Conclusion:

A. Main.main

B. Java.util

D. java.int

Learn more at https://brainly.com/question/17882992

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
Other Questions
Describe a journey you made where you learned something new.You should say:What happened on the journey.What forms of transport you used.How you felt and explain what you learned which was new. Refer to the above model. What processes are occurring along arrows D and E to turn both sedimentary rocks and igneous rocks into metamorphic rocks? A. melting and cooling B. erosion and deposition C. high temperatures and cementation D. extreme heat and pressure please help :)4. why did some sailors who explored the pacific northwest suffer from scurvy?a. sailors didn't eat fresh fruits and vegetables over long tripsb. sailors did not get treated for common virusesc. seasickness left untreated resulted in scurvyd. the salt air caused sailors to lose direction Find the value of x. Pls explain to me Im lost -15.6= -3.1+w/5 i didnt even learn this ;-; Which transitional word or phrase is most commonly used in the compare and contrast organizational pattern?On the other handAfter allNextFor exampleWill mark as brainlyst don't guss Athena decided to use drugs with her new friends. As a result, she was arrested for possession of marijuana. Athena is now assessing the outcome of her decision. What questions should Athena ask herself as she assesses the outcome of her decision? Check all that apply. How will my arrest affect my relationship with my old friends? How will I earn the trust of my parents again after lying to them? Will my new friends still like me even though Ive been arrested? How will an arrest record affect my chances of attending college? Will I be able to keep my job now that I have been in legal trouble? Who is the interpreter of the Constitution? Oriole Products manufactures two component parts: AJ40 and AJ60. AJ40 components are being introduced currently, and AJ60 parts have been in production for several years. For the upcoming period, 1,500 units of each product are planned for manufacturing. Assume that the only relevant overhead cost is for engineering change orders (any requested changes in product design or the manufacturing process). AJ40 components are expected to require 4 change orders and AJ60 only 2. Each AJ40 requires 1 machine hour, and each AJ60 requires 1.5 machine hours. The cost of a change order is $420.Required:Estimate the cost of engineering change orders for AJ40 and AJ60 components if Blue uses a traditional costing method and machine hours as the allocation base. HELP ME, its due at 9pmFind the coordinates of the other endpoint of the segment, given its midpoint and one endpoint. (Hint: Let(x,y) be the unknown endpoint. Apply the midpoint formula,and solve the two equations for x and y)midpoint (-24.18) endpoint (-19.10)The other endpoint is(Type an ordered pair Kim purchased a bottle of perfume for $1.50 per .80 ounce. What is the unit cost of the perfume? who or what is the focus of part 1 of Julie of the wolves according to the novels table of contents What movement questioned the ideas that supported inequity in France and helped to inspire the revolution? What does it mean when I "score" the surface of clay pieces? I OFFER 100 POINTS AND WHOEVER ANSWERS FIRST WILL BE BRAINLIEST (SHOW WORK IF YOU CAN PLZ)For f(X)=1/x-5 and g(X) =x^2+2, find f(g(x)) and (g o f)(6) what is the main purpose of yellow journalism Mechanic... Mechanical Engineer... What's the difference?Instructions: Answer the question below with at least TWO complete sentences. The thesis statement of a strong compare-and-contrast essay should combinetwo relevant details and the main topic.O the writer's viewpoint with a summary of the details.O the writer's observations with a viewpoint.the topic with the writer's viewpoint. Carter's football team played 10 games this season.They won only 20% of their games. How many gamesdid Carter's team lose? How do characters help to understand the themeof a book?