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

 

frew@mclean.com > slope
prev  |  next  |  chance

Compute the slope as a decimal. Formula: https://cdn.inchcalculator.com/wp-content/uploads/2019/09/slope-equation.png


slope(3, 1, 1, -5) → 3.0
slope(-5, -2, 7, -2) → 0.0
slope(5, 0, 3, 7) → -3.5

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

public double slope(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: 100

Copyright Nick Parlante 2017 - privacy