Question: Please write an operational C++ program that will read 3 text files with 12 colors and the corresponding RGB (Red-Green-Blue) hexadecimal and decimal corresponding codes.
Please write an operational C++ program that will read 3 text files with 12 colors and the corresponding RGB (Red-Green-Blue) hexadecimal and decimal corresponding codes. You need to read them and store them in string arrays. For reading the files please see the code snippet 2 below. You will use the elements you stored from the files in order to suggest color harmony to the user based on a user color selection and by means of the RGB Color Wheel. See figure 1.

Each of the 3 files has 12 elements. You have to read them automatically, all three of them, and load them into 3 different string arrays. You will need these data in the program. Display a small menu giving a brief introduction to the user explaining what the program does and what does he/she have to do (just input a color). You have to automatically display ONLY the 12 colors so the user can have a reference to type which color to use as a start. You have to validate the user input and make sure he/she typed the color correctly. However, the use of upper case, lower case or combinations of both is absolutely allowed, meaning that you have to make sure that the name of the color will be consistent every time. The user can input: ReD, reD, rEd or red and all these are VALID inputs since color red is one of the colors present in the wheel. It is a requirement to give feedback to the user if he/she did not input a correct color name. After the user provided a valid color, proceed to compute and display ALL the following:
1. Complementary Colors: are directly opposite one another on the color wheel. This option displays 2 colors, including the initial selection.
2. Triadic Colors: these type of harmonies consist of three colors equidistant from one another on the color wheel. This option displays 3 colors, including the initial selection.
3. Tetradic Colors: are formed by two sets of complementary colors 60 degrees apart on the color wheel. This option displays 4 colors, including the initial selection.
For each color (as applicable), you have to display: The color. i.e. Red The corresponding hexadecimal code. i.e. 0 F F0000 The corresponding RGB combination. i.e. R:255, G:0, B:0
Colors.txt = RED
ORANGE
YELLOW
CHARTREUSE GREEN
GREEN
SPRING GREEN
CYAN
AZURE
BLUE
VIOLET
MAGENTA
ROSE
Hex.text = FF0000
FF7F00
FFFF00
7FFF00
00FF00
00FF7F
00FFFF
007FFF
0000FF
7F00FF
FF00FF
FF007F
RGB.txt = 255,0,0
255,127,0
255,255,0
127,255,0
0,255,0
0,255,127
0,255,255
0,127,255
0,0,255
127,0,255
255,0,255
255,0,127
Red Rose Orange Magenta Yellow Chartreuse Green Violet Blue reen Azure Spring CyanGreen Red Rose Orange Magenta Yellow Chartreuse Green Violet Blue reen Azure Spring CyanGreen
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
