Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    Not yet.
    Nested statements need to be indented 3-4 spaces.
    The statements should NOT all start in the first column.

    There are if statements and for statements that are missing {} for the code...
  2. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    Its hard' to read and understand unformatted code.

    This statement is a clue for how to write the input reading loop:
    Assume the input ends with 0.

    The code should test the input's value for 0...
  3. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    The code is not properly formatted. Nested statements need to be indented 3-4 spaces.
    The statements should NOT all start in the first column.

    What happens when you compile and execute the ...
  4. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    Ask the user how many numbers he is going to enter, and use that value to control how many times the loops goes around. That will require the user to do an accurate count before entering the data...
  5. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    I suspect the program will continue to ask for numbers long after you get tired of entering them.

    You need to have code that makes the loop stop looping. See post#8
  6. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    Back tomorrow then.
  7. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    If it executes and generates the right results, then it could be correct.
    Did you fix the code for the problem I mentioned in post#8?

    Did you try typing in 100 numbers as the program reads input?...
  8. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    Here's a site with many coding conventions defined:
    Code Conventions for the Java Programming Language: Contents

    Look at some other postings on this site. Most have {}s
  9. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    The code tags are good. Now it needs the { and }

    If you keep entering numbers, The program will continue reading them forever. Try a few hundred to see.

    This is a hint of what the code...
  10. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    Put the following tag before the code:




    <YOUR CODE GOES HERE>


    Put the following tag after the code:
  11. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    Here's a site with many coding conventions defined:
    Code Conventions for the Java Programming Language: Contents
  12. Replies
    24
    Views
    1,356

    Re: Homework help what am I doing wrong?

    Is the program waiting for your input?
    To see where the code is executing, add some println() statements that print out messages to show you where the code is being executed.

    One potential...
Results 1 to 12 of 12