CSC 130 Power Series

Import the attached Eclipse project and the necessary classes and methods.  Do not change my code.  You may only add additional classes with their associated methods.

Write two classes that will interface with the attached code.  (note the use of the Java Math library)

The first class is the FibonacciSequence class. You will need to include the following methods for this class:

void printSequence(int count)

boolean validStartNumbers(int firstNumber, int secondNumber)

void printSequence(int firstNumber, int secondNumber, int count)

void resetSequence()

The second class is the PowerSeries class. You will need to include the following methods for this class:

void setX(double valueOfX)

void setNumOfTerms(int numberOfTerms)

double run_eTo_xSeries()

double run_sin_Of_xSeries()

You will also need my math2 class which is included in this project file.  It has a method int factorial(int newInt) that returns the value of X!( x factorial).  You will need this for the power series methods.

The following power series formulas are given as a help.

The geometric series formula

frac{1}{1-x} = sum_{n=0}^infty x^n = 1 + x + x^2 + x^3 + cdots,

which is valid for |x|<1, is one of the most important examples of a power series, as are the exponential function formula

e^x = sum_{n=0}^infty frac{x^n}{n!} = 1 + x + frac{x^2}{2!} + frac{x^3}{3!} + cdots,

Also valid for  |x|<1. and the sine formula

sin(x) = sum_{n=0}^infty frac{(-1)^n x^{2n+1}}{(2n+1)!} = x - frac{x^3}{3!} + frac{x^5}{5!} - frac{x^7}{7!}+cdots,

valid for all real x. Do to programming restrictions I restrict this sin series to 0 to Pi/2.  I also restrict each of the series from 1 to 17 or 20 depending on the series.  Again this is due to programming ease and not having to build special numeric constructs.

These references come from: http://en.wikipedia.org/wiki/Power_series

(hint: think about how to use for loops)

 
******CLICK ORDER NOW BELOW TO GET THE ANSWER TO THIS ASSIGNMENT OR ANY OTHER ASSIGNMENT, DISCUSSION, ESSAY, HOMEWORK OR QUESTION*******."
Open chat