Question: Overview Write an interactive Java program, ColorRange.java, which when given a wavelength in nanometers will return the corresponding color in the visible spectrum. Color
Overview Write an interactive Java program, ColorRange.java, which when given a wavelength in nanometers will return the corresponding color in the visible spectrum. Color Wavelength (nm) Violet 380-450 Blue 450-495 Green 495-570 Yellow 570-590 Orange 590-620 Red 620-750 Task You must implement the following using a suitable if decision statement. 1. Prompt the user to enter the wavelength, the wavelength should be of type double. 2. For each range (e.g. 380-450) the number on the left is included in the range, but the number on the right is not included in the range. 3. If the input value is not found on the visible spectrum then state that the wavelength is not within the visible spectrum. 4. Expected Output: a. Enter a color code 630 The color is Red b. Enter a color code 25.0 The entered wavelength is not a part of the visible spectrum C. Enter a color code 750.5 The entered wavelength is not a part of the visible spectrum
Step by Step Solution
3.45 Rating (148 Votes )
There are 3 Steps involved in it
Following is the program throughly import javaawtFlowLayout import javaawtGridLayout import javaawte... View full answer
Get step-by-step solutions from verified subject matter experts
