Write a top down program to calculate the velocity and the height of a ball of mass m thrown at mars 40times

Top down programming is to start with the skeleton, and worry about the details later.

See for example:
http://en.wikipedia.org/wiki/Top-down_and_bottom-up_design

Here, for example, the basic formulas of kinematics would be the backbone, and finding the value of g on mars is a detail.