Search:

Type: Posts; User: phlegm

Search: Search took 0.08 seconds.

  1. Replies
    11
    Views
    1,015

    [SOLVED] Re: Do-while loop help

    I figured it out, thanks everyone (Parranoia, and Norm).

    It was a very foolish error. The control statement was (g<0), when it should of been (g>0). I feel dumb. But thanks!
  2. Replies
    11
    Views
    1,015

    [SOLVED] Re: Do-while loop help

    This does help a lot, but do I create these variables in or out of the loop? Or does it not matter?

    --- Update ---

    Ok, so I think I improved my code. Thanks @Parranoia.

    ...
  3. Replies
    11
    Views
    1,015

    [SOLVED] Re: Do-while loop help

    I honestly don't know how I would set that up. sorry
  4. Replies
    11
    Views
    1,015

    [SOLVED] Re: Do-while loop help

    Yes I believe it would, but I don't know how to use g twice in the loop. :/

    Using the method I'm using, I would have a lot of code, so I realized I couldn't keep doing it the way I am.
  5. Replies
    11
    Views
    1,015

    [SOLVED] Re: Do-while loop help

    What I'm trying to do is to make only one System.out.println that will print every iteration. For example, if I enter in "6" into the command prompt, I would like this to be printed.

    36
    25
    16
    9...
  6. Replies
    11
    Views
    1,015

    [SOLVED] Do-while loop help

    What I am trying to accomplish is having the user input a number (5 for example), and then printing 25, 16, 9, 4, and then 1 (squaring each number until it hits 0).

    Here is the question: 2457
    ...
Results 1 to 6 of 6