$5.00 C++ help
- From Computer-Science: Programming-Methods
- Closed, but you can still post tutorials
- Due on Nov. 05, 2009
- Asked on Nov 02, 2009 at 3:23:14PM
Q:
So here is what I have:
- Uses double precision floating point variables
- Reads the masses of the two objects as input from the user
- Reads the distance between these two objects as input from the user
- Calculates the gravitational force between these objects
- Displays all data using the format given in the following sample output, which meet the following specifications:
ü The masses and distance should be displayed in fixed format, carried out to 2 decimal places. Their decimals should line up.
ü The gravitational constant and gravitational force should be displayed in scientific format, carried out to 4 decimal places. Their decimals should line up.
ü All unit values should line up.
Now I am using the following:
m1 is the mass of an object, in kilograms
m2 is the mass of another object, in kilograms
r2 is the square of the distance between the gravity centers of the two objects, in meters
G is the gravitational constant with a value of 6.6742 × 10-11 in Newton meters2 per kilograms2
F is the gravitational force measured in Newtons
I understand that this is pretty basic, but I cannot seem to get the right numbers to come out. Help!



