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

 

byngcompsci@gmail.com > distance
prev  |  next  |  chance

distance() -- given 2 sets of x and y coordinates, calculate the distance between them using the distance formula (http://www.purplemath.com/modules/distform.htm)


distance(0.0, 0.0, 3.0, 4.0) → 5.0
distance(0.0, 0.0, 5.0, 12.0) → 13.0
distance(0.0, 0.0, -7.0, -24.0) → 25.0

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

public double distance(double x1, double y1, double x2, double y2) { }

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

Difficulty: 15

Copyright Nick Parlante 2017 - privacy