Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Background: We can represent colors as RGB values. That is , as 3 integers representing the amount of red, green, and blue in the color.
Background: We can represent colors as RGB values. That is as integers representing the amount of red, green, and blue in the color. In this exercise, we will represent RGB values as digit integers, where the leftmost three digits represent red, the next three digits represent green, and the last three digits represent blue. Each of the red, green, and blue values are between and inclusive where is "entirely on and is "entirely off".
For example, the RGB values of orchid a purplish color are and We will represent that as the single integer
Note that the integer does not necessarily have to be nine digits, since it could contain leading zeroes. For example, if the RGB values are then we will represent that as the single integer
With this in mind, write the function getGreenrgb which takes an rgb value as described above, and returns the integer value of the green part of the given color. Thus, getGreen should return
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started