| Mark_Fizari 2006-05-21, 4:02 am |
| Hi,
i have jus started java programming, and i am struggling with it, and i was wondring if i could have some help with one of my tasks. ( PS. i am using Blue J).
Our task is to make a programthat help evaluate and draw polynomials. The polynomials will be entered in by the client as an array:
eg 3x^2 + 2x + 1 = {1 , 2 ,3}
or 4x^3 + 2x^2 +5 = {5 , 2 ,4}
the only 2 constructors we need are:
1. public Polynomial (int[ ] coeffs)
this is used to when the client jus wants to specify the entire array of coefficients in one go
2. Public Polynomial (int n)
This is used when the client wants a simple polynomial with term x ^ n , and doesnt want to put in large array consisting of mostly zeros
one aim of the task is to get the program to evaluate the polynomial.
eg f(x) = 2x^2 + 1
f(1)= 3
Another aim of the program is to be able to graph the polynomial over a given interval.
The last aim program was to find the roots of the polynomials, ie when the y value = 0.
One key aspect of the program was that the evaluater should only evaluate the polynomial and not draw or find roots, and the plotter should only plot and not evaluate or find roots, and the root finder should ONLY find roots.,
I desperatle need help with this task, and any sort of help will be appreciated..... Please help, soon
Many thanks |