Question: In the image below, the C++ function getColors is supposed to get two colors from the user. If the user enters something other than a
In the image below, the C++ function getColors is supposed to get two colors from the user. If the user enters something other than a primary color ( RED = 1, BLUE = 2, YELLOW = 3) OR if the user enters two of the same colors, a message should be displayed: "Invalid colors." Otherwise the message should be "Those are valid colors." The function getColors should be of type bool. My if statements are not correct because even if I enter two of the same numbers, the message, "Those are valid colors." is displayed. Please help me fix my if statements.

es rsymbols Resouroes 13 bool get Colors (int &, int & 14 int determine Color (1 15 void print color 15 17 int main o 18 int co11, co12: 19 if (getColors (coll co12 cout Tho arc valid colors." endl. 21 22 el 23 cout Invalid colors endl; return, 0 25 26 27 bool get colors (int & coll, int & co12) 28 H cout Enter your two primary colors i for red, 2 for blue, and 3 for yellow endl. 29 cout The two colors must be different." endl; 30 31 cin coll, co12 32 bool status 33 if C::11. status false; 31 35 else 36 if col1 RED && col1 BLUE coll YELLOM 37 status false 38 if co12 RED & & co12 BLUE & & col2 YELLOW 39 falae status 41 status true return status; 44 & oth ld GNU GCC Comp11 Debug SSt... varning: richt operand of cama operator has ao erect Runused traiuej
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
