just to make sure  does this /* Nick sauer
Remove Gray from RGB

Program Summary: input 3 total values
red, green and blue, it removes the gray from RBG.
*/

#include <iostream>

int main() {
    int red, green, blue;
    int value;

    //the red value
    std::cout << "Enter Red Value (0-255): ";
    std::cin >> red;
    std::cout << "\n";
    if (red < 0 || red > 255) {
        std::cout << "invalid" << std::endl;
        return 0;
    }

    //the green value
    std::cout << "Enter Green Value (0-255): ";
    std::cin >> green;
    std::cout << "\n";
    if (green < 0 || green > 255) {
        std::cout << "invalid" << std::endl;
        return 0;
    }

    //the blue value
    std::cout << "Enter Blue Value (0-255): ";
    std::cin >> blue;
    std::cout << "\n";
    if (blue < 0 || blue > 255) {
        std::cout << "invalid" << std::endl;
        return 0;
    }

    // Find the smallest value among red, green, and blue
    if (red <= green && red <= blue) {
        value = red;
    } else if (green <= red && green <= blue) {
        value = green;
    } else {
        value = blue;
    }

    red = red - value;
    green = green - value;
    blue = blue - value;

    // the RGB Results
    std::cout << "RGB: (" << red << ", " << green << ", " << blue << ")" << std::endl;

    return 0;
}
Week 05 Assignment: Remove Gray from RGB
 

Listen
Instructions
Complete the GDB assignment:
Use the following code to access the GDB assignment: e3ynq
Note - any comments left from students within GDB are NOT viewed and will not be answered.
Students should contact the instructor directly with any questions.
Solve the project as per the assignment instructions using the current weekly objectives/concepts..
Project should match the format in the expected results and pass all auto tests.
What to turn in:
Submit the assignment in OnlineGDB
Assignments NOT submitted are NOT viewable by the instructor and thus cannot be graded!
Download ⬇️ main.cpp from OnlineGDB
Upload main.cpp to this dropbox
Submit the D2L assignment
Project Specs
In the main.cpp file given, complete the program as specified below:
At the top of the source file, include a program comment block
Write a program that will allow the user to enter integer values for red, green, and blue
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 red, (0, 255, 0) is green, (0, 0, 255) is blue, (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
Using the values entered for red, green, and blue, remove the gray part, by finding the smallest value between (red, green, blue), and subtract it from all three values, thus removing the gray.
NOTE: you are NOT allowed to use std::min or std::max or any built in function to find the smallest value. The program must demonstrate your understanding on how to use selection control structures in your code to find the smallest value.
Additionally, you must perform input validation on each value entered to make sure it is in range of 0-255 and if not print the error message:
INPUT ERROR - Program Stop
Follow the DRY philosophy and Don't repeat yourself!
Make sure to follow the Program Rubric
Expected Program Output
Enter Red Value (0-255): 130

Enter Green Value (0-255): 50

Enter Blue Value (0-255): 130

RGB: (80, 0, 80)

Online C++ Compilers (NOTE: canNOT be used to submit the assignment):
https://cpp.sh/
https://www.programiz.com/cpp-programming/online-compiler/
https://codehs.com/sandbox


Says
Do everything