Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python Problem #1 Problem #5 Revisit the MixColors s Take your answer from Week 3 Wednesday for the MixColors program. We will split this into

python

image text in transcribed
Problem #1 Problem #5 Revisit the MixColors s Take your answer from Week 3 Wednesday for the MixColors program. We will split this into methods. Write a program named ColorFunction that does exactly the same thing but has the following three functions: * main(): This function will ask the user to enter two primary colors, and pass these values to the function mixColors(). It will then accept a return from mixColors(). *mixColors(): This function accepts two primary colors and determines the created secondary color. This color is returned. If it was not valid, return the string "not valid". "printValue(): This void function accepts a single string of the secondary color or "not valid" and prints the color or the message "You did not enter two primary colors". Sample Output Run #1 Enter the first primary color (small letters): red Enter the second primary color (small letters): blue You will get purple Sample Output Run #2 Enter the first primary color (small letters): red Enter the second primary color (small letters): red You did not enter two primary colors NOTE: Both this program and the one from week 3 get identical output, but programs with small functions like this are easier to maintain and understand

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

=+ What measures would an institutionalist suggest government use?

Answered: 1 week ago