Lab 3: Particle Man

Due by the end of class

We are going to employ the Power of Inheritance™ to simulate the motion of the subatomic particles electrons, neutrons, and protons in 2D. Although the locations of these particles will be random, the graphical display of them should look much like the following.

Particles

As times goes on, the electrons (represented in red) will whiz around, being attracted by the protons (represented in blue) and repulsed by each other. In general, the electrons will all eventually be flung into space and disappear. Slowly, the protons will repulse each other and drift apart. The neutrons (represented in green) have no charge and will remain in place.

Specification

Create a project called Lab3 and create a package in your project called particles. Download the following three files and add them to the particles package.

Electrons, Neutrons, and Protons

Now, add three new classes to the particles package called Electron, Neutron, and Proton, respectively. You will notice that they have compiler errors. Although you don't have to do much to complete the Electron, Neutron, and Proton classes, I won't tell you what it is you have to do. A little detective work should be enough. Once you complete these three classes, you should be able to run the Simulator class to see your code in action.

The only information you will need are the various values for charge, mass, radius, and color for each subatomic particle. This data is given in the table below.

Particle Charge (C) Mass (kg) Radius (m) Color
Electron -1.602176620898 × 10-19 9.1093835611 × 10-31 1.0 × 10-18 Red
Neutron 0.0 1.67492747121 × 10-27 0.8 × 10-15 Green
Proton 1.602176620898 × 10-19 1.6726219236951 × 10-27 0.876869 × 10-15 Blue

Turn In

Turn in your code by zipping up Electron.java, Neutron.java, and Proton.java from the Lab3\src\particles folder inside your workspace folder into a zip file. Then, upload this zip file to Blackboard. Do not upload the entire project. I only want the three files specified.

All work must be done individually. Never look at someone else's code. Please refer to the course policies if you have any questions about academic integrity. If you have trouble with the assignment, I am always available for assistance.