Declare and initialize secondary colors variables


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, 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. Otherwise, the program should display the name of the secondary color that results.

This is what I have so far:
// Declare and Initialize primary color variables
set string color1 = red
set string color2 = blue
set string color3 = yellow

// Declare and Initialize secondary colors variables
set string color4 = purple
set string color5 = orange
set string color6 = green

set color4 = color1 + color2
set color5 = color1 + color3
set color6 = color2 = color3

// Prompt the user to enter two primary colors
Display " Enter two primary colors:"
Input colors
Display input

If color1 = red And color2 = blue Then
Display "Mixing red and blue make purple." 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Declare and initialize secondary colors variables
Reference No:- TGS098887

Expected delivery within 24 Hours