C++ Need Help writing a Small program
Wavelenght of visible light fall approximately into the range 0.4--0.7 microns. The Table below shows the relationship between wavelenght and color.
Write a program that inputs a wavelenght and then displays the associated light color. If the wavelenght is shorter than 0.4 microns or longer than 0.7, display the message wavelenght outside visual range.
clasiffy boundary wavelenghts as the lower-wavelenght color.
For example, label a wavelenght of 0.424 microns as violet.
Color_________________________________Aproximate wavelenght range(microns)
------------------------------------------------------------------------------------------------------------
Violet________________________________________0.40 0--0.424
Blue_________________________________________0.424--0.491
Green_______________________________________0.491--0.575
Yellow_______________________________________0.575--0.585
Orange______________________________________0.585--0.647
Red_________________________________________0.647--0.700
I tried it but with no success, i had like 12 errors.