SPHERE
The compilation, linking and execution of the program remains the same:
>CC -c sphere.cxx >CC -c ball.cxx >CC -o sphere main.cxx sphere.o ball.o
And, the output will show the last ball starting at the initial position and then rising and falling:
>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: 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: 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: 3
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: 97
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: 98
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: 99
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: 99
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: 99
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: 99
myBall has position X: 3.6 Y: 4.0 Z: 13.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
...
myBall has position X: 31.8 Y: 4.0 Z: 99.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0
ballNumber: 99
myBall has position X: 32.0 Y: 4.0 Z: 100.0
myBall has velocity X: 0.2 Y: 0.0 Z: -1.0
ballNumber: 99
myBall has position X: 32.2 Y: 4.0 Z: 99.0
myBall has velocity X: 0.2 Y: 0.0 Z: -1.0
ballNumber: 99
myBall has position X: 32.4 Y: 4.0 Z: 98.0
myBall has velocity X: 0.2 Y: 0.0 Z: -1.0
...
ballNumber: 99
myBall has position X: 49.6 Y: 4.0 Z: 2.0
myBall has velocity X: 0.2 Y: 0.0 Z: -1.0
ballNumber: 99
myBall has position X: 49.8 Y: 4.0 Z: 1.0
myBall has velocity X: 0.2 Y: 0.0 Z: -1.0
ballNumber: 99
myBall has position X: 50.0 Y: 4.0 Z: 0.0
myBall has velocity X: 0.0 Y: 0.0 Z: 0.0
ballNumber: 99
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: 99
myBall has position X: 3.2 Y: 4.0 Z: 11.0
myBall has velocity X: 0.2 Y: 0.0 Z: 1.0