Question: This is for C++ and we are using if and else statements. (WILL LEAVE A LIKE! :D) Write a program that inputs a wavelength value

This is for C++ and we are using "if" and "else" statements. (WILL LEAVE A LIKE! :D) This is for C++ and we are using "if" and "else" statements.

Write a program that inputs a wavelength value from the user and decides the color based on the following intervals: Color Wavelength (nm) Violet 380 to less than 450 Blue 450 to less than 495 Green 495 to less than 570 Yellow 570 to less than 590 Orange 590 to less than 620 Red 620 to 750 If the wavelength is greater than or equal to 750 or less than 380, the program should print It is not a visible color. Sample output1: Please enter a wavelength value: 567 Green. Sample output2: Please enter a wavelength value: 300 It is not a visible light. Sample output3: Please enter a wavelength value: 890 It is not a visible light. Submit file name: wavelength.cpp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!