Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

>>>>>!!!!!!!Create pseudocode for the following program:!!!!!!!!!!!<<<<<< The co

ID: 3688689 • Letter: #

Question

>>>>>!!!!!!!Create pseudocode for the following program:!!!!!!!!!!!<<<<<<

The colors red, blue, and yellow are known as the primary colors because they cannot be made by mixing other colors. When you mix two primary colors, you get a secondary color, as shown here: When you mix red and blue, you get purple. When you mix red and yellow, you get orange. When you mix blue and yellow, you get green. Design a program that prompts the user to enter the names of two primary colors to mix. If the user enters anything other than “red”, “blue”, or “yellow”, the program should display an error message. Also, the two colors may not be the same. Otherwise, the program should display the name of the secondary color that results by mixing the two primary colors. In your pseudocode that implements a solution to the assigned problem, you should do the following: The color names are to be treated as strings. Your program should only allow the combinations listed in the problem, any other combination should produce an error message of “INVALID COMBINATION”.

Explanation / Answer

colors()

start:

1. Input color1 and color 2

2. if (color1 is not from red , blue , yellow) print "Color 1 is Invalid" goto 1.

3. if (color2 is not from red , blue , yellow) print " Color2 is invalid" goto 1.

4. mix _color ( color1 , color2)

     if (color1 =red & color2 =yellow) new_color = orange;

     else if (color1 = blue & color2=yellow) new_color=green;

     else print“INVALID COMBINATION”;

5. Stop

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote