Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. Let's Create a Color Mixer Program! Complete the following lines of code: a. Create a variable called color and set its value to user
3. Let's Create a Color Mixer Program! Complete the following lines of code: a. Create a variable called color and set its value to user input. You may be creative with the prompt, but it should indicate to the user to enter either "red", "yellow," or "blue." b. Create a variable called color and set its value to user input. You may be creative with the prompt, but it should indicate to the user to enter either "red", "yellow," or "blue." C. The next part is a complex series of if statements. We need to have a large set of if statements to account for all the possible color combinations. Please read each part carefully: i. If color1 is equal to the string "red": 1. If color2 is equal to "blue": a. Create a variable called color_result and set its value to "purple" 2. Else, if color2 is equal to "yellow": a. Create a variable called color_result and set its value to "orange" 3. Else, if color2 is equal to "red" a. Create a variable called color_result and set its value to "red" 4. Otherwise, create a variable called color_result and set its value to "Not Determined" ii. Else, if colori is equal to "blue": 1. If color2 is equal to "blue": a. Create a variable called color_result and set its value to "blue" 2. Else, if color2 is equal to "yellow"; a. Create a variable called color_result and set its value to "green" 3. Else, if color2 is equal to "red" a. Create a variable called color_result and set its value to "purple" 4. Otherwise, create a variable called color_result and set its value to "Not Determined Rubric Else, if color1 is equal to "yellow": 1. If color2 is equal to "blue": a. Create a variable called color_result and set its value to "green" 2. Else, if color2 is equal to "yellow": a. Create a variable called color_result and set its value to "yellow" 3. Else, if color2 is equal to "red" a. Create a variable called color_result and set its value to "orange" 4. Otherwise, create a variable called color_result and set its value to "Not Determined" iv. Else, create a variable called color_result and set its value to "Not Determined" d. Output the message "Your new color is" and then output the value of color_result on the same line
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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