Write a program in which a ball is released from a user-defined height and free-falls to the ground. The ball is pulled by earth's gravity of 9.8 m/sec2. Assume that each pixel represents 1 cm. Once the ball hits the ground is bounces up. Assume that the ball's elastic coefficient is 0.98 (i.e.: its initial velocity after impact is 98% of the velocity prior to impact).
Aside for the display panel, the frame shall also contain a text field in which the user will define the initial height (float, representing meters), a 'Start' and 'Stop' button.
Clicking the Start button will start the ball's motion from the user-defined height.
Clicking the Stop button will clear the height text field, and stop the ball's motion.
Challenge problem:
Show the ball "squashing" (having an oval shape) as it hits the ground.