Search:

Type: Posts; User: penguinCoder

Page 1 of 4 1 2 3 4

Search: Search took 0.10 seconds.

  1. 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. 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. Replies
    5
    Views
    687

    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...
  4. Replies
    9
    Views
    509

    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...
  5. Replies
    9
    Views
    509

    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.
    ...
  6. Replies
    9
    Views
    509

    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. Replies
    10
    Views
    580

    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. Replies
    10
    Views
    580

    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. Replies
    10
    Views
    580

    Re: i really need ur help guys.

    Hint: It involves modulus and the base of the number format you are using...
  10. Thread: Need help

    by penguinCoder
    Replies
    10
    Views
    447

    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. Replies
    3
    Views
    1,003

    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. Replies
    4
    Views
    479

    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. 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;...
  14. Thread: Need help

    by penguinCoder
    Replies
    10
    Views
    447

    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. Replies
    4
    Views
    479

    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. Replies
    7
    Views
    630

    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. Replies
    7
    Views
    630

    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. Replies
    7
    Views
    630

    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. 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. 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. Replies
    3
    Views
    1,992

    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. 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. Replies
    6
    Views
    1,305

    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. Replies
    4
    Views
    472

    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..
  25. Replies
    2
    Views
    849

    Re: Learning Java - What are your tips?

    You will soon learn that there is just about an infinite way of writing things. Java is an object-orientated language, yet if you want, you will never need to use objects. If you want you will...
Results 1 to 25 of 83
Page 1 of 4 1 2 3 4