The function takes 3 arguments:
- a as the coefficient of x²
- b as the coefficient of x
- c as the constant
Solution
Here we use the quadratic formula
First, we allow the user to enter inputs of coefficients of a, b and c using the Scanner class found on the java.util package.
This outputs the following on the terminal
Finally
Easy peesy:). Checkout full code on my github