Answered step by step
Verified Expert Solution
Question
1 Approved Answer
programming language is JAVA Energy of Light In physics, Planck's constant h is used to relate a photon's energy to its frequency. Planck's constant, h,
programming language is JAVA
Energy of Light In physics, Planck's constant h is used to relate a photon's energy to its frequency. Planck's constant, h, is defined as 6.626 x 10-34. Planck's constant can be used to calculate a photon's energy by using the formula E = hf where fis the frequency of the photon. A photon's frequency, in turn can be calculated from its wavelength using the formula f= where is the wavelength of the photon and c is the speed of light, defined as 3 x 108. With this information, write a program that accepts the wavelength of a photon. The program should calculate its frequency and energy using the formulae provided above. Note: Use constants to store Planck's constant and the speed of light. Use e-notation to write values for the constants and for any values that are expressed in powers of ten (see sample output and section 2.8 of the zyBook for examples in syntax) Samples of the output is shown below: Output 1: Enter the wavelength of the photon (in m): 700.0e-9 The frequency of the photon is 4.2857142857142856E14 Hertz. The energy of the photon is 2.83971428571428576-19 Joules. Output 2: Enter the wavelength of the photon (in m): 525.06-9 The frequency of the photon is 5.714285714285715E14 Hertz. The energy of the photon is 3.78628571428571476-19 Joules. Note that scientific notation can be used with upper or lower caseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started