Serge Metellus

Ranch Hand
+ Follow
since Nov 15, 2016
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Serge Metellus

Piet in the requirements it states that the add and insert have to be in the Polynomilal class which i explained earlier. Also, in the requirements it says that comparable is implement on the exponents ONLY meaning it does not matter what the coefficient is. You seem irritated but i tried to explain everything to you and  blatantly ignored me again and again. also when the coefficient is zero the entire term is zero so AGAIN it does not matter
7 years ago
Okay but insert has to be in the polynomial class not the Node class
7 years ago
that is exactly what i have been doing because those are the only two methods i have left to do in this entire program.

Carey Brown wrote:


^ what is that code?
7 years ago
how would i keep track of the previous node if there i did not declare a previous node in the node class and i don't think i am supposed to
7 years ago
no it has to be the custom linked list that i have so far. and what about the times method
7 years ago
7 years ago
the exception is line 17
here is the text
Exception in thread "main" java.lang.IllegalArgumentException: Term already exist
at LinkedPolynomial.insert(LinkedPolynomial.java:72)
at PolynomialTester.main(PolynomialTester.java:34)
/home/Surge/.cache/netbeans/8.2/executor-snippets/run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
7 years ago
i know im late  but here is my multiply/times method


my insert method


my multiply method only multiplies one term of one polynomial with all the terms of the other polynomial nut it does not repeat the process with the other terms. my insert method thwos the exception no matter what term i try to insert. i really need help on these last two methods. the assignment is due TONIGHT and i also have the programming final tomorrow morning
7 years ago
after speaking with my professor the plus method is supposed to throw an exception but a polynomial exception if the exponents are not equal. for the ordering i will try something like the one in piet's node class and will get back to you. i still do not see why add(Polynomialterm pt) is necessary when i basically have that method in the polynomial term class. like is said before myy code is working just out of order
7 years ago
Would this be correct for the compareTo method
7 years ago
the only changes in my PT class were the adding of the exception(i haven't designed the polynomial exception yet) and the compareto method because i am not exactly sure how to implement it

7 years ago
Here is my current code for the Polynomial(now LinkedPolynomial class)

it works but the terms are printed in opposite order. for instance if i just print out the polynomial with no operations done to it will print in the opposite order that it was inputed but after adding it to another polynomial it will print in the same order when it was inputed. what am i doing wrong?

Also, as i have said multiple times already i CANNOT, i repeat, CANNOT have another instance variable. my professor will not except it he is very strict about the way the assignment should done. For example in another assignment i had help from a tutor and the way the code was written was correct but that was not how he wanted it so i got a 76.
7 years ago
i use the same test code as the one from before. i use term.term.next because the first term refers to the node firstterm in the polynomial then the second term is the polynomial term referenced from the node class. Whats is an NPE?
7 years ago
when the polynomial class is the list itself the single variable requirement still stands so i cannot have a a head and tail variable only a head . in the code i posted above the problems seems to be with term.next when i remove the .next i get an ouput even if its incorrect but i think that is because of a tostring method that i created. Couk you show me what the t0string would look like?
7 years ago
you also said you understood what the requirement said regarding a single instance variable
7 years ago