Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

eric elysia

Ranch Hand
+ Follow
since Mar 06, 2005
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 eric elysia

OK, I got my loop figured out. Now I need to be able to change the color for each shell. I know where I need to change the color, but I am not sure how to compare the color.

I do know how to set the color: graphics.setColor(Color.red);

I thought about using an if statement like this:


Here is my working paintShells method:

[ February 11, 2007: Message edited by: eric elysia ]
15 years ago
I am writing a program to paint shells, for example:

149
238
567

I have written a method, but the method is not giving me the results I expect.

The approach I am using is:

rowNum = 1
As long as row is less than the size of the square side (for each row in column 1)

As long as rowNum is greater than colNum
Paint horizontally, moving from left to right
When rowNum = colNum, paint that square, then exit loop

As long as rowNum is greater than 1
Paint vertically moving up
When rowNum = 1, paint that square, then exit loop



I am getting an infinite loop, but I am not sure what condition(s) are causing the infinite loop.

[ February 10, 2007: Message edited by: eric elysia ]
[ February 10, 2007: Message edited by: eric elysia ]
15 years ago
Before I moved the javahw folder to the root of C, I was able to run the program with the package statements commented out.

I was also able to run javadoc.

Now that I have moved the javahw folder to the root of C, I am able to run the program with the package statements included, but I am not able to run javadoc. I have tried:

C:\>cd javahw

C:\JAVAHW>javadoc -doctitle "Alphabetizer" -author -version *.java
javadoc: error - File not found: "*.java"
1 error

C:\JAVAHW>C:\java\jdk1.5.0_06\bin\javadoc -doctitle "Alphabetizer" -author -version *.java
javadoc: error - File not found: "*.java"
1 error

C:\JAVAHW>

I would like to understand what I am doing wrong and how to fix it.

Thank you,
Eric
16 years ago
OK, sorry, now that I have read it, I see that it mentions packages. I am still a little confused about it.

Thanks,
Eric
16 years ago
It looks like your blog talks about the Development Environment, but I don't see anything about packages.

Eric
16 years ago
OK, I tried what you suggested.

I tried:

javac -classpath C:\Documents and Settings\Owner\Desktop\javahw

I got an invalid flag error. My guess is because of the "space" after Documents.

So I moved the javahw folder to the root of C:\

Then I went to Environmental Variables and changed the end of the path from C:\Documents and Settings\Owner\Desktop\javahw to C:\javahw.

I also did the same thing for the CLASSPATH.

Now, in jGrasp, it runs without the errors.

What was wrong?

Thanks,
Eric
[ January 28, 2006: Message edited by: eric elysia ]
16 years ago
Hello,

I am attempting to put two classes into a package.

I do not have any problems if I comment out the package statements.

I keep getting the following errors when I try to put the two classes into package hwone:







If someone can help me understand what I am doing wrong, I would really appreciate it.

Thanks,
Eric
[ January 28, 2006: Message edited by: eric elysia ]
16 years ago
Layne,

Thank you for your interest in my program. Unfortunately, I have to turn the program in now. Below is the final program that I am submitting.

Eric
16 years ago
In the Token class, the int is used to store one of the declared constants from the PostfixEvaluator class, (PLUS, SUB, TIMES, DIV, or NUMBER).

I am no longer using the Token class, but I can use it if you want to continue discussing it.

Thank you,
Eric
16 years ago
Layne,

Before you reply. Please take a look at my revised code. I think I have made things a little simpler. I think this code will be much easier to work with. I need to try to get this program finished tonight. I am willing to learn as much as I can.

The right parenthesis is only used to tell the program when to stop evaluating. I am really trying to make sure I understand every line of my program, but I am still having these problems. I need some help on where to declare the stack, StringBuffer, and charArray. Is it better to get rid of the charArray and just use the StringBuffer? I am not able to output the results into the output field (or testCaseOutputField). I would like to include an exception that only allows valid input. I would also like to include an empty list exception.

Eric


[ August 14, 2005: Message edited by: eric elysia ]
[ August 14, 2005: Message edited by: eric elysia ]
16 years ago
If it helps, this is the original program that I am trying to use as a guide:

Eric
16 years ago
Hello Layne,

The Token class is part of an example program that I found online. The List class and StackComposition class were given in my text and must be used to maintain the PostfixEvaluator class.

The Token class was created to to represent a Token object. The class uses two variables, int token, which is used to represent the token by number, and double value, which is the actual value of the token. The Token class has two constructors. The first constructor takes one int argument, which assigns the int argument to token. The second constructor takes two arguments, int and double, which assigns the int argument to token and the double argument to value. Method getToken returns the current value of token. Method getValue returns the current value of value.

Eric
[ August 13, 2005: Message edited by: eric elysia ]
16 years ago
My main questions are:

If I input anything other than a number, I get a NumberFormatException. I realize that this is happening because the method getToken() returns an int. How do I allow operators to be input?

Method displayCharArray() is not able to be invoked. I have tried this also with an array as a parameter, but it is still not being invoked. Any suggestions?

Method printStack() calls method print() in the List class. This is printing the stack to the Run I/O of the compiler, but I need to be able to set this as output. I am not sure how to do this.

Thanks,
Eric
16 years ago
I am getting the NumberFormatException because I call method getToken(), and token is an int in class Token.

I'm not sure what I need to change to allow operators to be input as well as numbers.

Thanks,
Eric
[ August 13, 2005: Message edited by: eric elysia ]
16 years ago
After looking over the code, here are some things I need help with.

If I input anything other than a number, I get a NumberFormatException.

Method displayCharArray() is not able to be invoked.

Method printStack() calls method print() in the List class. I need to be able to set this as output.

I'm not sure if I need method createStack(). I just wrote it to see if I might be able to use it.

Eric
[ August 12, 2005: Message edited by: eric elysia ]
16 years ago