This program will find or approximate roots of any given polynomial. In addition, it performs integration, derivation, maximum and minimum value searchings. Basically, this program looks for all possible real roots of a polynomial, or P(x) = 0 and P(x) = cn xn + cn-1 xn-1 + ...+c1 x + c0 . The user is asked to input the power of polynomial (degree) and the appropriate coefficients (c0, c1, c2 ... cn-1, cn) based on the power entered. Then, this program finds roots of a polynomial by using a numerical method for a power higher than 2 and a direct root solving method for a power equals or less than 2. For a polynomial power greater than 2 the user needs to enter an interval limit (a, and b where a < b) followed by a increment size (step) in order for the root approximation to work. The way this program approximates the roots is to take the average of the two closest values where the polynomial value changes from positive to negative or vice versa in a given range with a given step size. Moreover, the program will proceed to integration, derivation, maximum/minimum value findings if the user wants to by typing a "1". For the maximum/minimum value searching, again the user will be asked to enter an interval limit (a, and b where a < b). In order to do this real root approximation, the program will contain the following:
** Inheritance
**
Base Class(es)
Derived Classes(es)
Roots
RealRoot
RootError
Polynomial
Degree_N
Degree_2
Degree_1
** Virtual
Functions & Polymorphism **
Functions
Data Members
Polynomial
Integrate, Derive, Max, Min, Find_Root
** Other variables
**
Symbol
Definition
a
lower limit of interval entered by user
b
upper limit of interval entered by user
n (integer)
number of subintervals between "a" and "b"
step
size of increment
degree (integer)
power of the polynomial
Note: All types are double unless indicated
otherwise.