Challenge: Color Wheel
Test yourself and implement what you have learned so far in this challenge.
We'll cover the following
Problem Statement
You have to match all the primary colors to their complementary secondary colors. The matching is as follows:
Primary | Secondary |
---|---|
blue | orange |
yellow | purple |
red | green |
Input
The input will be the variable testVariable
which stores the primary color in the form of a String
.
testVariable
has already been declared for you.
Output
For the output, print the complementary secondary color of the primary color stored in testVariable
. If the input is anything but a primary color, the output should be "not a primary color"
.
Sample Input
"red"
Sample Output
"green"
Test Yourself
Write your code in the given area. Try the exercise by yourself first, but if you get stuck, the solution has been provided. Good luck!
//Write your code here
Let’s go over the solution review in the next lesson.