CIS115 Week 8 – Sample Question 6 – Guaranteed 100% score

Lab Price = \$4
[orb_cyber_store id=”295″]
Problem Statement
Complete the pseudocode by rewriting the algorithm. The colors red, blue, and yellow are known as primary colors because 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
Set 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”
EndIf
If (color1 = “yellow”) AND (_________) then
Display “secondary color is: green”
EndIf
End

Relevant Material
Instructions
* Please click on “Buy Now” button to complete the purchase.Please note that the payment is done through PayPal.
* If you have any issues with the payment method, please let us know at [email protected] and that can be discussed and considered.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at [email protected].