# منتديات طلاب الجامعات الأردنية > منتدى علم الحاسوب CS >  ارجو المسااعدة ضرووووووووري :(

## ابتسامة القدر

السلام عليكم  :Icon2:  
لوووو سمحتو بدي مساعدة بكتابة برنامج جافا ومش عارفة اعملو  :SnipeR (60):   :SnipeR (71): 


Define a java class to represent a real polynomial p(x). Each polynomial has a degree n (assume the maximum value of n is 8), and a set of coefficients which can be represented as an array of real coefficients: a0, a1,…, an (an ≠ 0).

p(x) = a0+ a1x+ a2x2+…+anxn


The class should have the following methods:

•	An overloaded constructor that takes the degree of the polynomial as an input argument, instantiates the coefficient array, then asks the client object to fill the array.

•	Another constructor that takes the degree as well as an array of coefficient s as inputs, the constructor then instantiates the coefficient s array and copy to it the array that was passed.


•	Add polynomial method that takes a polynomial object as an argument and returns a new polynomial that represents its sum with the calling object. For example c=a.add(b); assume that a,b,and c are polynomial objects. To add two polynomials a and b, we loop through the two arrays and add their coefficients. The  degree of the resulting polynomial is max (a.deg , b.deg). We initialize c to be the polynomial of degreeN with all zero coefficients.

•	Multiply polynomial method that takes a polynomial object as an argument and returns a new polynomial that represents their multiplication. For example c=a.multiply(b); assume that a,b,and c are polynomial objects. To multiply two polynomials, we use the elementary algorithm based on the distributive law. We multiply one polynomial by each term in the other, line up the results so that powers of x match, then add the terms to get the final result.
	o Example –3x(4x2 – x + 10)

ازا حد بيقدر يساعدني لو سمحتو  :Acebf6cab7:

----------


## ابتسامة القدر

لو سمحتو ياريت حد يساعدني   :SnipeR (72):

----------

