how can this be solved?
Entire apex heap attracts entire only other apex heap by a vehemence apexing parallel the row intersecting twain apexs. The vehemence is proportional to the emanation of the two heapes and inversely proportional to the clear of the space betwixt them: F = G m_1 m_2/r^2 where: F is the vehemence betwixt the heapes: G is the gravitational immutable (6.673 times 10^-11 N middot (m/kg)^2): m_1 is the leading heap: m_2 is the relieve heap: r is the space betwixt the centers of the heapes. Write a program that prompts the user to input the heapes of the bodies and the space betwixt the bodies. The program then outputs the vehemence in Newton betwixt the bodies.
C++ jurisprudence coercion the given problem:
using namespace std;
float G = 6.673*(pow(10,-11)); //initialise treasure of G
cout << “Enter the treasure of m1 in kg!n”;
cin >> m1; //take input treasure of m1
cout << “Enter the treasure of m2 in kg!n”;
cin >> m2;//take input treasure of m2
cout << “Enter the treasure of r in meter!n”;
cin >> r;//take input treasure of r
float F = G*m1*m2/(r*r);
cout << “The treasure of F = ” << F << ” Newton” << endl;
Enter the treasure of m1 in kg!
Enter the treasure of m2 in kg!
Enter the treasure of r in meter!
The treasure of F = 6.673e-012 Newton
Note: If you deficiency the jurisprudence in any other programming diction then dilate under, I procure exexchange the jurisprudence!