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

 

numQuadraticSolutions


Write a method called numQuadraticSolutions that takes a, b and c as input parameters which are a, b and c from a quadratic equation. This method should return the number of solutions to that quadratic equation. The discriminant (b*b - 4ac) tells you how many solutions there are.


numQuadraticSolutions(1, 0, 3) → 0
numQuadraticSolutions(1, 10, 3) → 2
numQuadraticSolutions(2, 4, 2) → 1

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

public int numQuadraticSolutions(int a, int b, int c){ }

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 Post-solution available

Copyright Nick Parlante 2017 - privacy