# Search:

Type: Posts; User: penguinCoder

Page 1 of 4 1

1. ## Thread: Recursion to Iteration, and Vice Versa

by penguinCoder
Replies
0
Views
379

### Recursion to Iteration, and Vice Versa

Can ANY loop be translated into a recursive method? And can ANY recursive method be translated into a loop? Is there any scenario where one wouldn't be able to handle what the other can?

Several...
2. ## Thread: Program that converts user input of ints into asterisks

by penguinCoder
Replies
3
Views
1,188

### Re: Program that converts user input of ints into asterisks

You only need an array of 10 that will accept an infinite amount of inputs. All you need to do is just:

arrayOf10Name[userInput - 1]++;

This will store then number of occurances to the...
3. ## Thread: Help with scrambling a word

by penguinCoder
Replies
5
Views
677

### Re: Help with scrambling a word

The best hint I could give you without giving to much of it away, would be to use something like:

char[] wordArray = word.toCharArray();

This will transfer you String word, into a character...

by penguinCoder
Replies
9
Views
497

### Re: Landscaped Histogram

I believe that you are going to have to start by using a single loop and a single comparison to find the largest occurances number. And then from there, you would be able to start displaying them...

by penguinCoder
Replies
9
Views
497

### Re: Landscaped Histogram

The easiest way I see for displaying the horizontal histogram, would be to loop a space one less then the index, and then at the end of the loop display a star. Something along the lines of that.
...

by penguinCoder
Replies
9
Views
497

### Re: Landscaped Histogram

Well, obviously you are going to need an array of integers with a 100 different indexes. The easiest way to load that array is going to be using the following method:
X = one of your numbers

...
7. ## Thread: i really need ur help guys.

by penguinCoder
Replies
10
Views
573

### Re: i really need ur help guys.

Just break it down into more manageable sections. Rather then thinking about the entire project, think of it as four parts.

A)Gather input from the user
Using println() methods and the Scanner...
8. ## Thread: i really need ur help guys.

by penguinCoder
Replies
10
Views
573

### Re: i really need ur help guys.

What did you have completed? Do you know how modulus works?

I can help you with the code, but I'm not going to write it all for you.
9. ## Thread: i really need ur help guys.

by penguinCoder
Replies
10
Views
573

### Re: i really need ur help guys.

Hint: It involves modulus and the base of the number format you are using...

by penguinCoder
Replies
10
Views
438

### Re: Need help

Even if the common case were to be between 0-10, it would still have to calculate 2 comparisons, which would be even with how it was written. In the worst case scenario, instead of doing 7...
11. ## Thread: Best Eclipse Tutorials for beginners?

by penguinCoder
Replies
3
Views
974

### Re: Best Eclipse Tutorials for beginners?

The NewBoston has one episode that is dedicated to Downloading and Running Eclipse. It doesn't go over a lot of advanced features, but it does cover everything that a beginner needs to know to be...
12. ## Thread: What does this assignment do

by penguinCoder
Replies
4
Views
463

### Re: What does this assignment do

If it wasn't static, wouldn't you need some kind of keyword before it; super, this, objectName, etc?..
13. ## Thread: 1 do while loop gives me 34 errors? ):

by penguinCoder
Replies
4
Views
477

### Re: 1 do while loop gives me 34 errors? ):

You really need to choose a type of formatting and just stick with it throughout the code. It seems like you change styles about 5 different times.
You do this for part of it:

for(int c = 0;...

by penguinCoder
Replies
10
Views
438

### Re: Need help

I like optimizing code far more then answering questions, so let me start off with some techniques that would let you optimize the code you have written.

Where you have:

if(mainChar == 'A' ||...
15. ## Thread: What does this assignment do

by penguinCoder
Replies
4
Views
463

### Re: What does this assignment do

It appears to be calling a static method with the parameters x and 3. It should display "Blah = [whatever the method returns]"
16. ## Thread: Avatar and Profile Picture

by penguinCoder
Replies
7
Views
612

### Re: Avatar and Profile Picture

Thanks for the response. I used the 'contact us' link at the bottom of the page in an attempt to contact the webmaster directly. I will post the response I get from him/her below for future members.
17. ## Thread: Avatar and Profile Picture

by penguinCoder
Replies
7
Views
612

### Re: Avatar and Profile Picture

So this problem was brought up 3 months ago yet there is still no official answer as to why, besides that of guess work. Should I take that to mean that this problem is not going to be addressed?
18. ## Thread: Avatar and Profile Picture

by penguinCoder
Replies
7
Views
612

### Avatar and Profile Picture

For some reason I am not able to post either a Avatar or a Profile picture..

I have a picture that is 100x100 pixels, that has a size of 15.1kb. It appears to be within the requirements of:

...
19. ## Thread: New and have a question on a probably simple question.

by penguinCoder
Replies
12
Views
523

### Re: New and have a question on a probably simple question.

It is what our teacher tells us about once a week.. Mind giving me an example, excluding recursion, of where they would be needed? Where regular code would not suffice... Or a link.
20. ## Thread: Boolean expression to put a name in proper form

by penguinCoder
Replies
11
Views
525

### Re: Boolean expression to put a name in proper form

I can see how it could be cut down, but to a single line of code?.. Would you mind illustrating this, via a post or pm? I would like to see how, for my own personal knowledge...

5 lines is the...
21. ## Thread: How to loop a main method

by penguinCoder
Replies
3
Views
1,897

### Re: How to loop a main method

First off, you should really wrap up your code in
tags so that it is much easier to read.

[code]
do{

...code...

}while(condition);
22. ## Thread: Calling variables from another method

by penguinCoder
Replies
2
Views
784

### Re: Calling variables from another method

Couldn't you just store the points in an array and then just pass the array to the next method via the parameters?
23. ## Thread: n Nested Loops

by penguinCoder
Replies
6
Views
1,259

### Re: n Nested Loops

First, I must say that I am not an expert at recursion, so there may be a better way of doing this then how I provide. This will however accomplish what you are trying to do, hopefully:

public...
24. ## Thread: problems with logical and

by penguinCoder
Replies
4
Views
463

### Re: problems with logical and

If you are just using 'y' and 'n', why not just use the type 'char'? It seems like you are wasting a byte of memory for nothing..