Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 Violet Blue Green Yellow Orange Red Wavelength (nm) 380-450 450-495 495-570 570-590 590-620 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 

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

Step: 1

Following is the program throughly import javaawtFlowLayout import javaawtGridLayout import javaawte... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Physics Principles with Applications

Authors: Douglas C. Giancoli

7th edition

978-0321869111, 321625927, 9780321733627, 321869117, 9780321625922, 321733622, 978-0321762429

More Books

Students also viewed these Physics questions

Question

Prove that if Σ an is absolutely convergent, then a. an

Answered: 1 week ago