Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JavaScript function called gravitationalPull which will calculate and return the gravitational attraction between two objects.with the following header: function gravitationalPull (m1, m2, s) The equation

JavaScript function called gravitationalPull which will calculate and return the gravitational attraction between two objects.with the following header:

function gravitationalPull (m1, m2, s)

The equation to use is:

Where:

is the gravitational attraction (the value to be returned) (Newtons)

are the masses of the two objects (kg)

is the distance between the two objects (meters)

is the gravitational constant, 6.67408 10-11(m3kg-1s-2)

var G = 6.67408e-11;

function gravitationalPull (m1, m2, s)

{

var retval = (G * m1 * m2) / (s * s);

return retval;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions