MAKEFILE
The object file ball.o must be recreated because the function declaration for fall in ball.cxx has changed.
In addition, we can also create a gravityball.o object file with the following commands at the prompt:
>CC -c ball.cxx
>CC -c gravityball.cxx

This compiles the programs ball.cxx and gravityball.cxx into the objects ball.o and gravityball.o.
The
main.cxx file can be compiled and linked with the following command at the prompt:

>CC -o sphere main.cxx sphere.o ball.o gravityball.o

The execution of the program now tracks the trajectory of the last ball created:

>sphere
mySphere has radius: 10.0
myOtherSphere has radius: 10.0
myOtherSphere has X position: 3.0
ballNumber: 0
myBall has position X: 3.0 Y: 4.0 Z: 10.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 0
myBall has position X: 3.2 Y: 4.0 Z: 11.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 0
myBall has position X: 3.4 Y: 4.0 Z: 12.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 1
myBall has position X: 3.0 Y: 4.0 Z: 10.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 1
myBall has position X: 3.2 Y: 4.0 Z: 11.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 2
myBall has position X: 3.0 Y: 4.0 Z: 10.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 2
myBall has position X: 3.2 Y: 4.0 Z: 11.0
myBall has velocity X: 0.2 Y: 0.0 Z: -8.8
ballNumber: 2
myBall has position X: 3.4 Y: 4.0 Z: 2.2
myBall has velocity X: 0.2 Y: 0.0 Z: -17.6
ballNumber: 2
myBall has position X: 3.6 Y: 4.0 Z: 0.0
myBall has velocity X: 0.0 Y: 0.0 Z: 0.0
ballNumber: 1
myBall has position X: 4.2 Y: 4.0 Z: 16.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 1
myBall has position X: 4.4 Y: 4.0 Z: 17.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 2
myBall has position X: 3.0 Y: 4.0 Z: 10.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 2
myBall has position X: 3.2 Y: 4.0 Z: 11.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 2
myBall has position X: 3.4 Y: 4.0 Z: 12.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0

note: the first ball number 2 was a gravityBall and it fell to the ground and was deleted before another ball was created