answer.
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
eimsori [14]
2 years ago
11

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 Find the smallest value, and then subtract it from all three values, thus removing the gray.Note: This page converts rgb values into colors.
the answer:
#include
using namespace std;
int main() {
int red;
int green;
int blue;
cin >> red >> green >> blue;
if ((red <= green) && (red <= blue)) {
cout << red;
}
else if ((green <= red) && (green <= blue)) {
cout << green;
}
else {
cout << blue;
}
return 0;
}
Computers and Technology
1 answer:
Dmitry_Shevchenko [17]2 years ago
5 0

Answer:

Follows are the code to this question:

#include<iostream>//defining header file

using namespace std;// use package

int main()//main method

{

int red,green,blue,x;//declaring integer variable

cin>> red >>green>>blue;//use input method to input value

if(red<green && red<blue)//defining if block that check red value is greater then green and blue  

{

x = red;//use x variable to store red value

}

else if(green<blue)//defining else if block that check green value greater then blue  

{

x= green; //use x variable to store green value

}

else//defining else block

{

x=blue;//use x variable to store blue value

}

red -= x;//subtract input integer value from x  

green -=x; //subtract input integer value from x

blue -= x;//subtract input integer value from x

cout<<red<<" "<<green<<" "<<blue;//print value

return 0;

}

Output:

130 50 130

80 0 80

Explanation:

In the given code, inside the main method, four integers "red, green, blue, and x" are defined, in which "red, green, and blue" is used for input the value from the user end. In the next step, a conditional statement is used, in the if block, it checks red variable value is greater than then "green and blue" variable. If the condition is true, it will store red variable value in "x", otherwise, it will goto else if block.

  • In this block, it checks the green variable value greater than the blue variable value. if the condition is true it will store the green variable value in x variable.
  • In the next step, else block is defined, that store blue variable value in x variable, at the last step input variable, is used that subtracts the value from x and print its value.      
You might be interested in
How is the IT function organized in your school or place of employment? Create an organization chart showing how the IT organiza
kkurt [141]

Answer:

A

At my place of employment (which is a knowledge based business) the IT function integrates with all aspect of the operations which include:

  1. top management,
  2. business units,
  3. customers,
  4. non-IT suppliers, and
  5. IT providers.

The IT function manages the entire information technology value chain within the organisation. It provides solutions with regard to the software and hardware IT infrastructure.

We have a locally developed software which forms the frame work upon which our business rests. We refer to this as the Primary Production software. Other software which come preinstalled or post-installed on our machines are referred to as Secondary Production softwares.

All the hardware upon which the Primary and Secondary Production software run on are also managed the the IT Unit.

Every aspect of our operations described above must at somepoint interface or require the expertise of the IT Unit.

Our customers rely on the Primary software.

Business Units must a manager key functions for the Primary software on the backend and rely on secondary production software for other administrative tasks.

B

Please see attached the organisational chart that shows how the above relationships interplay.

C

At our organization, it is critical for the IT function to be centralized.

All decisions are made from the IT unit of the head quarters and cascaded into business units and other IT units at various branch locations.

6 0
1 year ago
Two-dimensional array indexes are listed as
Luda [366]

Answer:

rows and columns, or matrix

Explanation:

Two-dimensional 2D arrays are being indexed with the help of two subscripts. The first one is for the row and the second one if for the column. And each of the elements of the 2D array must be of the one kind like they all can be an object type or they all can be of primitive type.

Like:

int A[3][3];

The above is the 2-dimensional array in C++, and elements are of type int, which is a primitive data type.

5 0
2 years ago
Which of the following is true with regard to defensive programming? Preconditions should never be visible to callers. Program c
Firlakuza [10]

Answer:

The correct point about defensive programming is that the "program code frequently assumes that input will be valid and that algorithms will behave as expected".

Explanation:

8 0
2 years ago
Propane also known as LP gas, is often mixed with about _______ percent of other gases, such as butane, propylene, and mercaptan
vitfil [10]

Answer:

30

Explanation:

Java - Using a method, how do I "write a program whose input is a character and a string, and whose output indicates the number of times the character appears in the string. Your program must define and call the following method that returns the number of times the input character appears in the input string.

public static int countCharacters(char userChar, String userString)"

4 0
2 years ago
Write multiple if statements: If carYear is before 1968, print "Probably has few safety features." (without quotes). If after 19
jekas [21]

Answer:

Following is the statement in the C language :

if(carYear < 1968)

printf("\nProbably has a few safety features.\n");

if(carYear > 1970 && carYear <=1991 )

printf("\nProbably has head rests.\n");

if(carYear > 1991 && carYear <=2002)

printf("\nProbably has anti-lock brakes\n.");

if(carYear > 2002)

printf("\nProbably has airbags.\n");

Explanation:

Following is the description of the statement:

  • In the given question we used if block. The if block is only executed when their condition is true.
  • if(carYear < 1968) In this we check we the value of "carYear" variable is less then 1968 then it prints "Probably has a few safety features." in the console window.
  • if(carYear > 1970 && carYear <=1991) In this we check we the value of "carYear" variable is greater then 1970 and less then 1992 it prints "Probably has head rests" in the console window.
  • if(carYear > 1991 && carYear <=2002 ) In this we check we the value of "carYear" variable is greater then 1991 and less then 2003 it prints "Probably has anti-lock brakes" in the console window.
  • if(carYear > 2002) In this we check we the value of "carYear" variable is greater then 2002 then it prints "Probably has airbags" in the console window.

6 0
2 years ago
Other questions:
  • Which of the following best describes the concept behind Web 2.0
    5·1 answer
  • Use a VLOOKUP function in cell I5 to identify and calculate the federal withholding tax. Use the tax rates from the range D21:E2
    15·1 answer
  • Which item is essential to know before sketching a navigation menu flowchart? template specifics, such as horizontal or vertical
    12·1 answer
  • vertical exchanges are typically used only to buy and sell materials required for an organization's support activities ( True or
    14·2 answers
  • Write the definition of a function named quadratic that receives three double parameters a, b, c. If the value of a is 0 then th
    12·1 answer
  • A U.S. social security number consists of a string of 9 digits, such as "444422333". Assume that input consists of a sequence of
    6·2 answers
  • Mara's presentation included essential information about the company's new safety procedures. She wanted to make
    13·2 answers
  • 15) The codes for class Hotel has been defined in two separate files Hotel.h, and Hotel.cpp. Which of the following statements i
    12·1 answer
  • Sensors and devices connected to a model are examples of which of the following?
    6·2 answers
  • Which of the following statements is true regarding ARPANET? Select 3 options. It was a product of Bell Laboratories and was int
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!