In this chapter we want to examine the conservation of momentum in a completely elastic collision. In our example, two cars will collide head on. In a perfectly elastic collision both the momentum and the kinetic energy will be conserved.
INPUTS:
A user will enter masses and velocities of both cars.
A button can be clicked to crash the cars.
OUTPUTS:
The velocities after the collision will be calculated and displayed on the GUI
The velocity of the car going to the left should be negative. If the user enters a negative value, use it. If they enter a positive value change it to negative in your program before you use it in calculations.
Display velocities to the tenths place.
CRITERIA & CONSTRAINTS:
Clicking the button will crash the cars.
This is completely elastic so both momentum and energy will be conserved.
The velocities of the cars after the collision will be opposite what they were before.
Your program should have an impressive interface. (colors and graphics)
Specify units.
Set up variables and get the two masses and two velocities from the GUI.
If the v2 variable is negative, leave it. If it is positive change it to negative.
Derive the final velocities.
Print the velocities to the GUI to the tenths place.