I need to know how to input this into python on zybooks. I've been stuck on this for days and I keep running into "invalid syntax" or "unknown word red" Summary: 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. Ex: If the input is 130 50 130, the output is: 80 0 80 Find the smallest value, and then subtract it from all three values, thus removing the gray.

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. So

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.

I Need To Know How To Input This Into Python On Zybooks. I've Been Stuck On This For Days And I Keep

Related Questions

If String str = "United States";, then what is the value of str.indexOf("united");?

−1
0
1
2
3

Answers

Answer:

-1

Explanation:

due to the fact their is no capital "U" it will -1

SOMEONE HELP PLZZZZ!!!!

Answers

Answer:

D

Explanation

LAN = Local Access Network

The IT worker works on networks.

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

What would be the state of the following list after each of the first four passes in a Bubble sort, sorting into ascending sequence?
(a) 65, 34, 28, 68, 52, 21

Answers

Answer:

21,28,34,52,65,68

Explanation:

Following are the Python program to Bubble sort the given array value.

Program:

def sort(l):#defining the a method sort that takes list value in parameter

   for n in range(len(l)-1, 0, -1):#defining a loop that counts list value and performs the swapping

       for i in range(n):#defining another loop that counts range of list

           if l[i] > l[i + 1]:#defining if block that check list number value

               l[i], l[i + 1] = l[i + 1], l[i]#performing the swapping

l=[ 65, 34, 28, 68, 52, 21]#defining a list l that holds integer value

print("Unsorted list: ")#print message

print(l)#print list value

sort(l)#calling the sort method

print("Sorted Array: ")#print message

print(l)#print sorted list value

Output:

Please find the attached file.

Program Explanation:

Defining the method "sort" that takes list value "l" as a parameter, and defines a loop that counts list values and performs the swapping.Inside the loop, another loop is defined that counts the range of the list and uses a conditional statement.In this case, it uses an if block that checks the list number value and performs the swapping.Outside the method, a list "l" that holds integer values is used, and the print method that calls and prints its value.

Find out more about the sorting here:

brainly.com/question/18568184

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

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

Dan works for an automobile company. He has designed a new model of a car based on an older version. Which technology can he use to present the model at a board meeting?
A.
wearable computing
B.
3-D printing
C.
grid computing
D.
screenless display

Answers

Answer:

a

Explanation:

i did the test

Answer:

The answer is B (3-D printing)

Explanation:

changing the layout of a document or the text is called....

Answers

The Answer is:

Formatting.

Unscramble the words

A: ESUOM RETUPOC

B: KSID EVIRD

Answers

A. Mouse coputer
B. Disk drive
A) Mouse copter
B) Disk Drive
hope this helps x

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

Plz help meeeeee QUICKLY!!! WORTH 15 POINTS!

Answers

Answer:

Im pretty sure Domain name system but dont trust me

Explanation:

Workbook and worksheet are synonymous, where each workbook will contain only one worksheet

True or false

Answers

False a Brainiest would be appreciated if I’m right
This is a false statement

whats the answer to 9? i really need help with this in the next 20 minutes. ty if u help me!

Answers

Answer:

A very precise number B

Explanation:

Hope you pass

write a letter to your friend telling him how computer has made learning easier to students

Answers

Answer:

Dear friend

How are you i am writing this letter to tell you how computer has made my learning easier to students.Computer is a great device to help in school work.Because it processes information and your school work,it evens help you to get done work easier and quicker.It dosent matter which coumpuer you use.Technology is a very useful source i hope you see it easier to use.I hope you enjoy what i write to you

Yours truly

Explanation:

i hope you enjoy my letter that i help you with message me

When writing a letter to your friend, it is important to:

State the reason you are writing to him.Let him know the specific ways the computer has made learning easier.Make some jokes and lighthearted comments.Promise to keep in touch.End the letter.

What is an Informal Letter?

This refers to the type of letter where a person writes to a friend or acquaintance and makes use of slangs and informal language.

Read more about informal letter here:
https://brainly.com/question/18879087

Which is the civil penalty for COPYRIGHTS violations? Choose the answer. $200-$150,000 fine up to five years in jail Fines and court costs 1 year in jail

Answers

Answer: $200-$150,000 fine

Explanation:

I took the Quiz

A struggle between opposing forces or characters is

Answers

Answer:

Conflicts

Explanation:

The struggle between two opposing forces or characters in a story. Conflicts can exist between two people, between a person and nature or a machine or between a person a whole society. a conflict can be internal, involving opposing forces within a person's mind.

Answer:

Conflict

Explanation: Took the test

What is the issue with this code

interface Box2{

static final int ITEM_CODE=201;

int method1();

double method2();
}

public class Window implements Box2{

public int method1(){

return ITEM_CODE;

}

}

public class myFrame{

public static void main(String args[]){

Window w = new Window();

System.out.println(w.method1());

}

}

A.
The interface should be declared as abstract.
B.
The class should be declared as abstract.
C.
The interface should have an implementation of method2.
D.
The class should have an implementation of method2.

Answers

Question: What is the issue with this code

interface Box2{

static final int ITEM_CODE=201;

int method1();

double method2();

public class Window implements Box2{

public int method1(){

return ITEM_CODE;

public class myFrame{

public static void main(String args[]){

Window w = new Window();

System.out.println(w.method1());

A. The interface should be declared as abstract.

B. The class should be declared as abstract.

C. The interface should have an implementation of method2.

D. The class should have an implementation of method2.

Answer: A The interface should be declared as abstract.

Often used in connection with a business
A: fair use
B: copy right
C: public domain
D: commercial use
E: Creative Commons

Answers

Answer:

I would have to say public domain (but i am not sure)

Name the application pagram used in creating the
document above​

Answers

Answer:

Excel or Google Sheets

Explanation:

What Information Technology is Walt Thomas responsible for?

Answers

Proactive designing i think

Answer:   employee productivity and activity management, selling the vast.

Explanation:

divisions of a keyboard​

Answers

Answer:

There are 4 SECTORS!

Explanation:

Alphabetical (Word keys, main function keys), Numeric (Number keys. which is the number pad to your right), The function keys (Like Num. lock, and the F keys that go through F1 to F12), and the Cursor keys (Which is LITERALLY just the arrow keys) But if you were a gamer like me, you'd know that WASD is better for gamers.

Another mention: Control Keys ( Includes your Windows Icon, Left Ctrl, Alt, Fn(If it's there) Your Tab key, your Caps, Shift, and Right Ctrl.)

Xcode, Swift, and Appy Pie are all tools for doing what? A: Writing code in Java. B: Creating smartphone apps. C: Creating apps to run on a desktop or laptop. D: Writing code in C#​

Answers

Answer:

Creating smartphone apps

Explanation:

Took the test, got 100, read the lesson on slide 3 towards the bottom

how does air conditioner work
please short answer please​

Answers

It draws the warm/ hot air from inside to outside and the AC unit (usually outside) turns the vapor into a liquid which removes any excess heat. (This is the way I learned it)
The air conditioner in a central heating and cooling system provides cool air through ductwork inside your home, by providing a process that draws out the warm air inside, removing its heat.

Changing the position of the wing will

Answers

Answer:

will cause error in your pc many many many

Answer:

change the center of gravity and neutral point

Explanation:

When would you use database software instead of spreadsheet or word processing software?​

Answers

Answer: When I need to see table relationships and sort data by custom fields.

Explanation:

Answer: When I need to see table relationships and sort data by custom fields.

Explanation: took the quiz

He made me so angry when he didn’t let me make my point that I had to stalk after him.
a.
follow
c.
stem
b.
shoot
d.
branch

Answers

Answer: follow

Explanation:

Answer: A) follow

Explanation:

Poems are a kind of persuasive document
Yes or no?

Answers

Answer:

i believe the answer yes because the author wants the audience sympathetic attention.

Answer:False

Explanation:

What is the art of getting your work done through people in a harmonious way?
A.
having good interpersonal skills
B.
having good work ethics
C.
having high self-esteem
D.
having high work efficiency
E.
having conflict resolution skills

Answers

Answer:

A.

having good interpersonal skills

Answer:

it is (A)

Explanation:

Use the drop-down menus to complete the steps for using the Scenario command.


1. Select the cells you want to use in your scenario.


2. Go to the ____ tab.

Data
Home
Insert
Formulas

3. In the Forecast group, select _____ and click Scenario Manager.

Sort
Get Data
Forecast Sheet
What-If Analysis

4. Click Add and fill in the name and add comments if you wish.


5. To compare, you will want to create _____ version.

A what-If
A original
A Data Table

6. Add a second scenario, changing the values from the first.


7. Click _____ to view the values in each scenario.

OK
Show
Review

Answers

Answer:

1. Select the cells you want to use in your scenario.

2. Go to the Data tab.

3. In the Forecast group, select What-if Analysis and click Scenario Manager.

4. Click Add and fill in the name and add comments if you wish.

5. To compare, you will want to create an original version.

6. Add a second scenario, changing the values from the first.

7. Click show to view the values in each scenario.

I got the answer right on Edge :)

The cells a person want to use are:

Go to the Data tab. In the Forecast group, select What-if Analysis and click Scenario Manager.Click Add and fill in the name and add comments if you wish. To compare, you will want to create an original version.

What is cell?

A cell is known to be area that is found on a spreadsheet that is known to be the place where the data are said to be entered.

Note that in the case above, The cells a person want to use are:

Go to the Data tab. In the Forecast group, select What-if Analysis and click Scenario Manager.Click Add and fill in the name and add comments if you wish. To compare, you will want to create an original version

Learn more about cells from

https://brainly.com/question/13920046

#SPJ9

Please Help Asap!

Fill in the blanks:

URLs are the global _____ of resources on the Internet.

URLs are to web browsers what postal addresses are
to ______.

URL structure is: Protocol + Domain Name + _______.

Answers

Answer:

addresses

envelopes

directory path

Explanation:

URLs are the global addresses of resources on the Internet. URLs are to web browsers what postal addresses are to envelopes. URL structure is: Protocol + Domain Name + directory path.

What is meant by URL link?

Just as homes and other buildings have a street address, websites have unique addresses to make it simpler for users to find them. On the Internet, these are referred to as URLs Uniform Resource Locators.

Most websites use "HTTP" or "HTTPS" to denote their protocol. This part of the URL is followed by a colon and two forward slashes, as in the example below: http://website.com. https://website.com.

Type: It gives information about the type of server where the file is kept. address: It provides the location or address of the internet server. The file's location on the internet server is indicated by the path.

Thus, addresses, envelopes and directory path.

For more information about URL link, click here:

https://brainly.com/question/23615920

#SPJ2

Other Questions
Solve: -3 + 7 -5 + (-10) Which branch of government most directly affects you on daily basis? China, France, Russia, and Germany are part of the Security Council.TrueFalse Find the equation of the perpendicular bisect of the given segment by following these steps1. Determine the slope of the given segment Theres a popular place in the Spanish-speaking community where people have conversations with neighbors friends watch people or even buy open air markets what is its name Jack sells cars. Last year he sold 30 cars. The next year Jack sold 48 cars. What is the percent of change? Help!Why quantitative research is important to senior high school student? The election of which President helped lead to the Civil War? HELP!!!!!!!!!!!PLEASE Explain ONE difference in the way the Mongols economically affected two regions under theircontrol. Check all true statements.A. For all nonempty sets A, B, C, D, if A x B = C x D, then A = C and B = D. B. For all sets A, B, the power set of the cartesian product of A and B is the cartesian product of the power sets of A and B. If A={1,2} and B={3} then A x B ={ {1,3}, {2,3} }. C. The cartesian product has a cancellation property, i.e. if A x B = A x C for some sets A, B, C and A nonempty, then B = C. If A={1,2} and B={3} then A x B ={ (1,3), (2,3) }. D. The cartesian product is symmetric, i.e. A x B = B x A for all sets A, B. For all sets A, B, the cardinality of A x B is the sum of the cardinalities of A and B. E. The cartesian product is associative, i.e. (A x B) x C = A x (B x C) =for all sets A, B, C. Both sets are equal to A x B x C. F. The cartesian product has a cancellation property, i.e. if A x B = A x C for some sets A, B, C, then B = C. 2. A(n) __ is an individual number,figure, or letter in a sequence. The ideas of the _________________ were expressed in the English Bill of Rights, which helped to increase Parliaments powers.a.Magna Cartac.Parliments Decreeb.Glorious Revolutiond.None of the above Consumer behavior is the way that forces shape people'sA. goods and servicesB. place and time utilityC. culture and societyD. activities related to buying Plz help it would mean a lot Which describes a way that water cycles through organisms? O A. Waves collide onto a beach. B. A plant is eaten by an animal. C. Rain falls from clouds. O D. A rock breaks in a rainstorm. TRUE OR FALSe The executive branch is Made up of 2 houses the senate and the House of Representatives In the diagram below, lines x and y are parallel. What is the relationship between angle b and e? Write an equation if it help Which theme is shared by "My Childhood Home I See Again" and Kinship: A Family's Journey in Africa and America? (poem and story attached download)A) Memories are often unreliable, offering only a glimpse or an echo of the truth.B) Sometimes information or knowledge will completely alter how a person understands the world.C) It is impossible to relive the past, and trying to do so will only end in heartache.D) One must overcome fear of new experiences to fully enjoy life. (oeerivona, please help me! quick!)which angles of transformed figures have the same measure as c in figure ABC?