Overview Write an interactive Java program, ColorRange.java, which when given a wavelength in nanometers will return...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
Following is the program throughly import javaawtFlowLayout import javaawtGridLayout import javaawte... View the full answer
Related Book For
Posted Date:
Students also viewed these physics questions
-
The wavelength range of the visible spectrum is approximately 400-700 nm. White light falls at normal incidence on a diffraction grating that bas 350slits/mm, find the angular width of the visible...
-
Write a Java program that simulates car racing, as shown in Figure 16.22(a). The car moves from left to right. When it hits the right end, it restarts from the left and continues the same process....
-
Write a java program to compute all prime numbers less than equal to a given integer N using the algorithm "Sieve of Eratosthenes". The Sieve of Eratosthenes is a method used to compute all primes...
-
An autoglass company located in Detroit produces mirrors for automobiles. The company supplies auto mirrors to a nearby Ford (The Ford Motor Company, Dearborn, MI) plant. The demand for mirrors from...
-
Consider two workers with identical preferences, Phil and Bill. Both workers have the same life cycle wage path in that they face the same wage at every age, and they know what their future wages...
-
Pollution Control. Three types of coal, C1, C2, and C3, are pulverized and mixed together to produce 50 tons per hour needed to power a plant for generating electricity. The burning of coal emits...
-
What happens to the air density, pressure, temperature, and total energy when it passes through a normal shock wave?
-
Suppose that KraftyCity has to pay $50 per workbench for orders under 200 but only $42 per workbench for or ders of 201 or more. Using the information provided in problem 7, what order quantity...
-
A laser emits a pulse of light which travels at a speed of c (in vacuum) relative to the laser. Does this mean that the speed of the laser relative to the light pulse is also c? Explain your...
-
Ramada Company produces one golf cart model. A partially complete table of company costs follows: Required: 1. Complete the table. 2. Ramada sells its carts for $1,200 each. Prepare a contribution...
-
What is a Gantt chart? How can you apply it to your weekly school life?
-
Consider the following system of periodic processes executing on a single CPU: Can we add another instance of P1 to the system and meet all the deadlines using RMS? Process Execution time Deadline...
-
Develop a generic streaming interface for an accelerator. The interface should allow streaming data to be read by the accelerator from the hosts memory. It should also allow streaming data to be...
-
What criteria are used to classify species in an evolutionary classification system?
-
Why is bacterial decomposition important?
-
Explain how bacteria that are autotrophs and chemoautotrophs obtain food.
-
What are the contents of an application record? Specify the Rule. And provide that an application record must contain the following information . Brad Pout, an avid horse enthusiast, met an...
-
Prove that if Σ an is absolutely convergent, then a. an
-
A helium-filled balloon escapes a child's hand at sea level and 20.0C. When it reaches an altitude of 3600 m, where the temperature is 5.0C and the pressure only 0.68 atm, how will its volume compare...
-
The heat capacity, C, of an object is defined as the amount of heat needed to raise its temperature by 1 C. Thus, to raise the temperature by T requires heat Q given by Q = C T. (a) Write the heat...
-
A stone is thrown vertically upward with a speed of 15.5 m / s from the edge of a cliff 75.0 m high (Fig. 2-48). (a) How much later does it reach the bottom of the cliff? (b) What is its speed just...
-
When a contracting hot ball of gas spins into a disk shape, it cools faster due to (a) increased radiation transfer. (b) increased surface area. (c) decreased insulation. (d) increased convection...
-
The Sun contains what percentage of the solar systems mass? (a) about 35% (b) 85% (c) the percentage varies over time (d) over 99%
-
The nebular theory is based on the observation that the solar system (a) follows patterns indicating that it formed progressively from physical processes. (b) has a structure much like an atom. (c)...
Study smarter with the SolutionInn App