The purpose of this assignment is to practice creating C# programs using MS Visual Studio. In order to make it easier for the instructor to grade assignments, please name the project files and program files exactly as given in the assignment.
The energy output, E , of a photon in Joules (J) can be computed using the formula:
E = P
f where P is Planck's constant equal to 6.626 x 10 34 and f is the frequency of the photon in Hertz (Hz). We would like a program that will compute the energy of photons of varying frequencies.
Create a C# project named PhotonEnergyProgram. Rename file "Program.cs" to "PhotonEnergy.cs" (and the class "Program" to "PhotonEnergy").
Write a C# program that implements a solution to this problem. It must meet the following specifications:
It should declare a named constant for Planck's constant
It should declare variables for the frequency and the energy of a photon.
It should assign 5.7 appropriate labeling x 10 14 to the frequency variable, then compute the energy of a photon of this frequency, then output the photon frequency and energy output of the photon to the console with
The program output might look like:
The energy output of a photon with frequency 570000000000000 Hz is
You can look up output formatting in Chapter 2 of the textbook, but formatting is not required for this assignment. We will discuss output formatting on Wednesday.
Create a zipfile of your entire PhotonEnergyProgram project folder and submit it using the submission system as explained in the handout Submission Instructions for CS 205.
01/13/2011 Page 1 of 1 D. Hwang