it asks to make a program for RationalPolynomials and I don't know how to start this. I don't understand the arrays much.
Seems like you are planning to use arrays to store each element in a polynomial.
Each Element have a Rational number as coeffecient, A variable x and an exponent. You need to have a class to represent each element. Call the class 'Element'. Then an array (or collection) of Elements represent your rational polynomial.
If ordering of elements is important, You may use an array or an implementation of OrderedList. Another idea is to extend HashMap and use exponent as key(key need to be non-primitive type).
Below is how you declare a single dimension array.
To initialize the array you need to know the size(number of elemts needed). You can obtain the 'polynomialSize' by counting the '+' (or '-').
Now the array can be initialized by
Now asigning values to polynomial....
In a loop construct each 'Element'. use i as index.
You can refrence the polynomial elements as below.
You have the basics of Array by now.