Search:

Type: Posts; User: Norm

Page 1 of 2 1 2

Search: Search took 0.14 seconds.

  1. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    I don't see what you need a loop for.

    I'm done for tonight. Back tomorrow.
  2. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    The while loop is for the validate step. The computation step follows the validation step.

    If the computation step requires a loop, it would be a new loop, not part of the validation loop.
  3. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    From post#19:
    Here is some pseudo code:
    get input from user
    validate input
    use input in computations <<<<<<<<<< NOTE this comes after validate input
    print out results <<<<<<<<< NOTE this...
  4. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    Make the list of steps for the program in pseudo code before coding the program.
    When you have the list of steps, then write the code.
    Don't write code before you have gotten the steps figured out....
  5. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    You could do the computations after getting the input
    and validating it.
  6. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    Break down the step: Compute the results
    into simple single steps.
    Is there any need for a loop to compute the results?
  7. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    What step in the list of pseudo code steps does the code in the do loop accomplish?


    What happens when the code in post#44 is compiled and executed?

    If you would label the end of methods it...
  8. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    It is confusing to have comments that are wrong. The end of a class is different than the end of a method.


    Earlier there was pseudo code that listed a possible order of the steps to solve the...
  9. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    }//End validateInput method <<<<<<<A

    }//End main method <<<<<<<<<<B


    There is an error right there. It looks like the end of the main() method at B includes another method ending at A....
  10. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    Have you fixed the compiler errors yet?
  11. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    What are the steps: method1 and method2? Their names don't have any relationship to what the program is doing.
  12. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    The formatting for the code is poor which makes it very hard to read.

    Review this pseudo code from an earlier post as a suggestion for what order to do things:
    get input from user
    validate input...
  13. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    That's one requirement: that all {s must have a pairing }
    One way to check for unpaired {}s
    Print out the source code on paper and use a pencil: circle the { and draw a line to its } and circle...
  14. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    Perhaps you need to take a break and try something else. If you are having counting and pairing {s and }s in a small program, I don't know what will happen when you try to write a bigger program.
  15. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    To clearly see which } ends a method,
    label all the }s that end a method with a comment:
    } // end main()

    } // end validateInput()


    Each method should have only one ending }
  16. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    Where is the ending } for the main() method?

    To clearly see which } ends a method,
    label all the }s that end a method with a comment:
    } // end main()

    } // end validateInput()
  17. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    For readability the } in the above line should be on the next line and inline below the statement with the pairing }


    You need to check the correct pairing of each { with a }.
    There should be a...
  18. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    What happens when you compile and execute the code?
    If there are errors, then its not correct.
    If you get the right answers, then it could be correct.

    Where is line 51 that is mentioned in the...
  19. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    Wait until you are at your computer to send messages.
  20. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    You have left off the source line numbers for the compiler errors making it hard to find them.
    Here is a sample of an error message from the javac command:


    TestSorts.java:138: cannot find...
  21. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    Here is some pseudo code:
    get input from user
    validate input
    use input in computations
    print out results
  22. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    Also posted at: ValidInput errors and return error. - Dev Shed
  23. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    See post#6

    When you get errors, you need to copy the full text of the error messages and paste it here.



    public static void main(String[] args) {
    // TODO Auto-generated method stub...
  24. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    Where will it print that message? How does the code that prints the message get executed? If you don't call a method, the code in the method will not be executed.


    Did you compile the code with...
  25. Replies
    58
    Views
    3,978

    Re: Need some minor help.

    Copy and paste here the text of any error messages you want help with along with the code.
Results 1 to 25 of 30
Page 1 of 2 1 2