Home Segments Index Top Previous Next

108: Practice

The gravitational attraction of the earth on an object is proportional to the inverse square of the distance between the center of the earth and the center of the object. Write a program that determines the relative weight of an object at two distances. Write and use a function name square in your solution. Use your program to determine how much more an object weighs at sea level than at the top of Mount Everest. Also use your program to determine how much more an object is attracted to the center of the earth at sea level than it would be if it were at the same distance from the center as is the earth's moon.