ann.math.polynomial.PolynomialD2

PolynomialD2.java defines a degree 2 polynomial class. This class extends PolynomialD1

NOTE: Polynomial terms are white-space delimited.

Examples: 1 + 2x - 3xx, 1 +2x -3xx, 1 -2x + 3xx are all ok.

 

public PolynomialD2()

Default constructor

Postcondition: myA == 0.0 && myB == 0.0 && myC == 0.0.

 

public PolynomialD2(double aValue, double bValue, double cValue)

Construct from double

Receive: double aValue, double bValue, double cValue.

Postcondition: myA == aValue && myB == bValue && myC == cValue.

 

public PolynomialD2(String polyString)

Construct from String

Receive: String polyString.

Precondition: strPolyD1 is of the form "a + bx + cxx" or "a + bX + cXX", where a and b are numeric values.

Postcondition: myA == a && myB == b && myC == c.

 

public double getC()

C-attribute accessor

Return: myC.

 

public void setC(double newC)

C-attribute mutator

Receive: double newC.

Postcondition: myC == newC.

 

public String toString()

String converter (output)

Return: the String equivalent to me.

 


Back to the package documentation index


Back to the Introduction


Copyright 2000 by Prentice Hall. All rights reserved.