This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 2. Gravity: Write a C++ program to compute the gravitational force F g acting on a mass m in a circular orbit with radius r = 100 r E , where r E is the radius of the Earth. You should ask the user to enter the mass ( m in kg) and print out the corresponding gravitational force F g . The Law of Universal Gravitation states that 2 2 1 r m m G F g = for any two masses m 1 and m 2 . Note that Earths mass m E = 5.9742 10 24 kg, Earths radius r E = 6378.1 km, and G =6.673 10-11 m 3 /(kg-s). Submit your code, named gravity.cpp , to Ctools....
View Full Document
- Spring '07