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...
-
Suppose that the gas-phase reaction 2 NO(g) + O2(g) 2 NO2(g) were carried out in a constant-volume container at constant temperature. Would the measured heat change represent H or E? If there is a...
-
An electric utility is considering a photovoltaic (PV) solar panel system to provide power to water conditioning pumps within the power plant. The project will be done in two phases. Phase 1 has an...
-
How and why would a country give up any of its sovereign powers?
-
SVI is a large securities dealer. Last year, the company made 150,000 trades with an average commission of $60. Because of the general economic climate, SVI expects trade volume to decline by 15...
-
15 16 17 18 In 1987, an agreement was formulated by the United Nations Environment Programme (UNEP) to freeze the production of "X" to prevent depletion of "Y". "X" and "Y" respectively referred here...
-
As a financial analyst at Glencolin International (GI) you have been asked to evaluate two capital investment alternatives submitted by the production department of the firm. Before beginning your...
-
. Based on CZ method, the engineer wants to produce Si Ingot with 10 cm of diameter and 1 meter of height. (10 points) (a) At least how much weight of Si is required in the crucible to melt? (5...
-
a. Michael bought shares of Apple Inc. on NASDAQ in the US one year ago for USD 90. Today, the share price is USD 147. Over the year, Malaysian Ringgit (MYR) depreciated against USD by 30%. If...
-
X(s) 10 A system with transfer function F(s) 40s +14s+1 f(t)= 10 sin(0.2t). Find the response x(t) at steady state. = is subject to a sinusoidal input 2 A certain system has a frequency response...
-
Explain fully how to find the values for Net Income, Cash Flow and NPV for the Base case, Worst case and Best case. If variable cost increase by 10% 20 or increase by $2 1.1 Now variable cost 22 ...
-
A typical profit-maximizing firm in a perfectly competitive constant-cost industry is earning a positive economic profit. (a) Is the market price greater than, less than, or equal to the firm's...
-
O'Brien Company manufactures and sells one product. The following information pertains to each of the company's first three years of operations: Variable costs per unit: Manufacturing: Direct...
-
Calculate the WACC for a firm with a debtequity ratio of 1.5. The debt pays 10 percent interest and the equity is expected to return 16 percent. Assume a 35 percent tax rate and riskfree debt.
-
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...
-
Using a search engine such as Google, search for power of a hypothesis test. Describe what the power of a hypothesis test is.
-
What do p, p, and P-value represent?
-
H 0 : The lottery is fair. Ha: The lottery is biased. Without using the terms null hypothesis and alternative hypothesis, identify the type I error and identify the type II error.
Study smarter with the SolutionInn App