Question: A physics student gets unexpected results when using the code double force = G * mass1 * mass2 / r * r; to compute values
A physics student gets unexpected results when using the code double force = G * mass1 * mass2 / r * r;
to compute values according to the formula F = Gm1m2 / r2. Explain the problem and correct the code.
Step by Step Solution
3.34 Rating (163 Votes )
There are 3 Steps involved in it
In the given code the physics student is trying to implement the formula of gravitational force F Gm... View full answer
Get step-by-step solutions from verified subject matter experts
