Johnny Steele

Greenhorn
+ Follow
since Nov 12, 2010
Merit badge: grant badges
Biography
I am being summoned on a peregrination of sound and flight. Never has such an endeavor foreseen emmense anticipation for the grand outcome and the impact, which will ricochet and inject itself into the world that engulfs it. One day, the current trends will be compromised and all that remains are the thoughts of future successes.
For More
Tucson, Az
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 Johnny Steele

got it!!! I figured it out. thanks!!!
12 years ago
Hi,

Im trying to build a method that adds a node to this tree. It takes arguments, a number representing the order at which this node needs to be placed in the tree, and the element that the node is to contain.

so for example,

..............25
............./...\
.........16......50
......./...\.........\
...14....20........75

so if I were to add the number 30 it would be at 50.left

if there is a matching duplicate number, I have to return the element of the node being replaced.

this is what I have so far...
its not wright but its a start.
I'm getting nullPointerExceptions on my tests so far.

any advice?

thanks
12 years ago
thanks! But how would I do the same thing without decimalFormat using toString?
13 years ago
Hi!

I'm creating a method that inserts commas in an integer given as an argument and returns it as a string with the commas inserted in the propor places. I have the following but does anyone have any ideas as to how I can do this without importing decimal format, like with toString or the like?


13 years ago
that seems to work!!! thank you very much!!! I did not think to use a for loop as in the past we've been told to avoid loops but not with this one.

thanks a lot!!!
13 years ago
my assignment requires it to be witten using recursion.
13 years ago
Hi,

Who loves recursion?!?!?!?!

So, given an array of ints I need to recursively find the number of times a particular integer appears in that array. Like so:



This code is creating a huge stackOverFlow error when I unit test it. I am at a loss. I am allowed to use private helper methods although I am a bit confused as to how that would help in general or particular to this case. Regardless, any suggestions?

Thank you much
13 years ago
I found that I had to instantiate all the variables in the private class. Took me a while to figure out!!!

13 years ago


hey everyone. So i'm working on my own version of mineSweeper. My professor's explanation, even after several times asking, doesn't seem to quite click with me. In the following code, I have to implement the MineSweeper constructor and my needed instance variable in it. So I've been told the constructor is taking an array of GameSquare objects. My question is: how do I initialize the information within each object if the GameSquare class if Private? Then, how do I call this array later in order to set the my other methods such as isFlagged, click, and so on? Just need a push in the right direction and some clarity, I'm quite confused. Thanks!!! Oh, this method is being implemented in such a way so that I can do some unit testing. There is another constructor using a random number generator but I believe the point of this one is testing.


as you can see I started but have no idea what i''m doing.
-Thank you ahead of time.
13 years ago
Thanks. Sorry about posting this twice. i know to use "\n" but as of now I cannot use StringBuilder. I'm just not sure how or where to put "\n" in order to get the desired diagonal printed.
Thanks again for the response,
-john
13 years ago
Hi! I'm working on a method that takes in an array called number and returns its contents to be printed in a diagonal like so:

with tabs in between and each element printed on a new line.
Here is my method which is obviously very wrong but its what I have.

Just cant figure out how to incorporate the new line into a loop or object for that matter.
Thanks,
-John
13 years ago
Hi! I'm working on a method that takes in an array called number and returns its contents to be printed in a diagonal like so:

with tabs in between and each element printed on a new line.
Here is my method which is obviously very wrong but its what I have.

Just cant figure out how to incorporate the new line into a loop or object for that matter.
Thanks,
13 years ago