Class QuadraticSolver

java.lang.Object
math.quadratic.QuadraticSolver

public class QuadraticSolver extends Object
  • Field Details

    • a

      private double a
    • b

      private double b
    • c

      private double c
  • Constructor Details

    • QuadraticSolver

      public QuadraticSolver(double a, double b, double c)
      Parameters:
      a - the co-efficient of the squared variable
      b - the co-efficient of the variable
      c - the constant term
  • Method Details

    • setA

      public void setA(double a)
      Parameters:
      a - the co-efficient of the squared variable
    • getA

      public double getA()
      Returns:
      the co-efficient of the squared variable
    • setB

      public void setB(double b)
      Parameters:
      b - the co-efficient of the variable
    • getB

      public double getB()
      Returns:
      the co-efficient of the squared variable
    • setC

      public void setC(double c)
      Parameters:
      c - the constant term
    • getC

      public double getC()
      Returns:
      the constant term
    • solve

      public String solve()
      Returns:
      the solutions as a string of values.
    • soln

      public String[] soln()
      Returns:
      the solutions as an array of values
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • main

      public static void main(String[] args)