Cain Silverbane

Greenhorn
+ Follow
since Jul 22, 2002
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 Cain Silverbane

Hmm... that indeed help me on my way! Thanks a lot, to everyone. I really love how the 'community' here helps one another.
It seems I wasn't giving enough information to you all, and for that I apologize. The bulk of the problem revolved around the my mis-coding of the previous().... I had put a reference to m_lastReturned when it should have been m_current.m_prev. Then, after fixing the other parts (which was in part thx to people here , I got it running!
Thanks again, everyone.
21 years ago
hrmm... shouldnt have trouble, I wouldn't think... what exactly are you doing?
doing things such as x * y * z should be just as easy as x * y. Be sure to remember to have it all stored into something:
volume = length * height * width;
21 years ago
Here is the add before...

As it stands now, I am having a lot of trouble with references... the program we are using runs a number of test cases, and if you get an error it tells you what you should have. It says I should be getting a number of ints, but instead I am getting memory locations.
Our teacher said to do the mod count... to make sure any other methods don't alter it without you knowing or some such...
Ah, and here is the actual link part...

As I see it, the addBefore means that it is added before m_current.
21 years ago
Hi again, all. For class we are now writing our own add method for the linked lists under a class MyLinkedListIterator. Can anyone help point out what it is I am doing wrong? If you need to see more of my code, let me know. Thx.
21 years ago
One of the main things Im having trouble with is getting the first number to be the size of the array, and the others to go into the array. A sorting method should be simple enough, and getting the display isn't worrying me too much.
21 years ago
Hmm... still not getting anywhere. We are supposed to make LineFilter private and then create a main to do various things, as well as other methods... basically get the numbers from a file, sort em, print em... Ack.
21 years ago
Ok, here is the deal. I am getting ready for a test and trying to practice stuff, so the prof. gave me a lab. It is supposed to basically use a filename as a command line argument, read the #s in, and print them out in a neat 5 column style.
The #s are supposed to be sorted first, lowest to highest [without using arrays.sort()]. Also, the first # in the file needs to be set to the array length. He said to use Integer.toString() for spacing, and to make a reusable file-sorting object.
He also is letting us use a LineFilter class that we have made before in class (see below). If anyone can throw some code to give me an idea how to do it / start, I would appreciate it.
21 years ago
Wahoo! You people are genius! *grins* And although it is basically a solution, I like that you didn't just actually show me what to do (ie. change the code for me) because it helps me learn. Someone tried explaining it to me earlier today and I just didn't know what they meant... be sure that I will be posting again, and for HELP, not handouts.
Anyway, I think I got it now... I just did a lil editing...

Figured that way the - numbers would work and not give wierd ascii symbols. Once again, I thank you!

[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ August 01, 2002: Message edited by: Dirk Schreckmann ]
21 years ago
Ok. Here is the idea. We are to make a main method that calls upon a method (that accepts an int and returns a string). The method cannot use simple methods such as toString or the such-- we have to do the conversion 'manually'. Well, I had it 'semi-working'. The program would take the int, return the ASCII code equivalent ('0' = 48, '1' = 49, etc.), and it would be in reverse order... any ideas? I will post the code below just because it is really short (for the method-- main just takes an int and sends it, gets it back from the method and displays it with a few tests)
//here it is
public static String myIntToString(int num)
{
String stringNum = "";
int tempNum = num;
int lastDigit;
do
{
lastDigit = tempNum % 10;
stringNum = stringNum + (char)(lastDigit + 48);
tempNum = tempNum / 10;
}
while (tempNum != 0);
return stringNum;
}
21 years ago
I'll be sure to do that. Thanks for such speedy responses. I appreciate it.
21 years ago
Thanks, Dave.
The site is defintely a good start (and I am reading some of it now). I guess it is hard to give a question because I am really just looking for a place to start (an example of sorts)
I guess it would be easier to see my code and know what I am talking about. Anyway, for now, I will try to find it out via the tutorial. Thanks again!
21 years ago
Hi there. Sorry about the last post (if ya missed it, don't worry about it I have a question. Again, I am working on some excercises for a class. I can't quite understand the book as well as I would like and wondered...
Could anyone help explain how to use try, catch, and throw methods, and when to use them?
We have a few different .java files and we had to make 4 new exceptions (via RuntimeException) One class (the one that is supposedly reusable) is meant to use try and catchs, while the other (for a particular bank) is meant to use throws.
If anyone can explain that, or help me, just reply here or email me (Ore_CladDragon@yahoo.com). Also, if you wish, I can email/icq you the code (95kb zipped). Thanks in advance!
21 years ago
Ok, I will post the code here. My filters don't seem to work and I can't find out what I am doing wrong for the life of me... other than that I beleive it works. If someone sees it before midnight tonight (its due then) plz reply. Thx.

[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ July 22, 2002: Message edited by: Dirk Schreckmann ]
21 years ago