at first I had terms.add(null); which I thought was the problem, then I replaced it with terms.add(coeff); terms.add(expo); and after each time I used Sop(terms); and it has the same result.
Type: Posts; User: Pinares
at first I had terms.add(null); which I thought was the problem, then I replaced it with terms.add(coeff); terms.add(expo); and after each time I used Sop(terms); and it has the same result.
Okay, I fixed the output loop problem, now I'm still having trouble with my insert method:
public void insert(int coeff, int expo)
{
for(int i = 0; i < terms.size(); i++)
...
It does not give me a chance to put in another input.
I guess it would be the input variable that controls the loop, i have:
while(input !=null)
but even after just one input, the input window closes and it starts printing. Maybe its the way I set...
Still nothing for any variable on that line, but when I delete everything and just keep this line:
System.out.println("insert method called for " + coeff + " " + expo);
it prints in an...
There is a println() statement at the end of the insert method that was printing earlier, but now not even that shows up. it gives me this message:
Exception in thread "main"...
So here is my latest insert method:
public void insert(int coeff, int expo)
{
if(terms.isEmpty())
{
terms.add(null);
}
Okay. Sorry about that, I was getting a bit frustrated. Right now I am working on my insert method that adds terms to the list in descending order of power, I'm having trouble with the descending...
As of now, the test class, this is what is has to do:
III. The Test Class
The main method of your test class will create a Polynomial object and then read and process a series of operations...
Here's the assignment:
I. The Term Class
Create a class to represent a term in an algebraic expression. As defined here, a term consists of an integer coefficient and a nonnegative integer...