id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

konstans@stuy.edu set1 > force
prev  |  next  |  chance

Force can be calculated as the gravitational constant (g) times the product of the two masses(m1 and m2), then by dividing by the distance (r) squared.


force(1.0, 1.0, 1.0, 1.0) → 1.0
force(2.0, 3.0, 4.0, 1.0) → 24.0
force(2.0, 3.0, 4.0, 2.0) → 6.0

...Save, Compile, Run (ctrl-enter)

public double force(double g, double m1, double m2, double r){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Copyright Nick Parlante 2017 - privacy