CIS 115 (Devry) help Making Decisions/uophelp.com CIS 115 (Devry) help Making Decisions/uophelp.com | Page 14
they cannot be made by mixing other colors. When you mix two primary
colors, you get a secondary color. Mixing yellow and blue gets you
green. Mixing red and blue gets you purple. The algorithm allows the
user to enter two primary colors and then displays the resulting
secondary color. The colors entered by the user will be validated to
ensure they entered a primary color.
Begin
Declare String color1
Declare String color2
Declare String control1
Declare String control2
_____ “Enter first primary color: “
Input _____
Prompt “Enter the second primary color: “
Input _____
Set control1 = “n”
DOWHILE control1 = “n”
If (color1 <> “yellow”) _____ (color1 <> “red”) _____ (color1 <>
“blue”) then
Prompt “first primary color is invalid”
Input _____
Else
S et control1 = “y”
ENDO
Set control2 = “n”
DOWHILE control2 = “n”
If (color2 <> “yellow”) _____ (color2 <> “red”) _____ (color2 <>
“blue”) then
Prompt “second primary color is invalid”
Input color2
Else
Set control2 = “y”
ENDO
If (color1 = “red”) AND (_____) then
Display “secondary color is: purple”