ann.math.polynomial.PolynomialD3

 

PolynomialD3.java defines a degree 3 polynomial class. This class extends PolynomialD2.

NOTE: Polynomial terms are white-space delimited.

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

 

public PolynomialD3()

Default constructor

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

 

public PolynomialD3(double aValue, double bValue, double cValue, double dValue)

Construct from double

Receive: double aValue, double bValue, double cValue.

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

 

public PolynomialD3(String polyString)

Construct from String

Receive: String polyString.

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

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

 

public double getD()

D-attribute accessor

Return: myD.

 

public void setD(double newD)

C-attribute mutator

Receive: double newD.

Postcondition: myD == newD.

 

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.