| about | help | code help+videos | done | prefs |
quadratic
Recall the quadratic formula -b + sqrt(b^2 - 4 a c) / 2a. (Here, b^2 is the square of b - though ^ doesn't work this way in Java!) Given a, b, and c, compute the value of the quadratic formula. You can use Math.sqrt(x) to compute x's square root. quadratic(1, 2, -3) → 1.0 quadratic(1, 0, -4) → 2.0 quadratic(2, 5, 3) → -1.0 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 140
Copyright Nick Parlante 2017 - privacy