Search:

Type: Posts; User: Norm

Search: Search took 0.20 seconds.

  1. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    Sounds like it's time to get the teenager more involved.
  2. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    Your code calls several methods:
    Math.random()
    System.out.println(num...
    input.nextInt()

    It needs to call the guess() method if you want the method to execute.

    Have you tried Google about:...
  3. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    How/where does your code "CALL" the guess() method?
  4. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    If you don't call a method it will NOT be executed.

    Here's some more tutorial: Passing Information to a Method or a Constructor (The Java™ Tutorials > Learning the Java Language > Classes and...
  5. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    What is the purpose of the guess() method? It reads a number from the user and does nothing with it. Should it return the number to the caller?
    Where does the code call the guess() method? If a...
  6. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    That is a for loop. Have you read the tutorial that describes for loops?
    The for Statement (The Java™ Tutorials > Learning the Java Language > Language Basics)
    Java for loops are like those is most...
  7. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    See how to define a method: Defining Methods (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

    Having the names of methods be the same as variable names can be confusing. ...
  8. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    What is the guess() method supposed to do? It defines an int variable, assigns it a value and then drops it. Should the method return the value it gets from the user?

    NOTE: coding conventions...
  9. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    The idea is to help the OP learn how to program, not to do his work for him.
    If you do post code, it should have comments describing how the solution was found and what it does.
  10. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    I think writing several simple java programs is a good way to learn. I don't know a shorter way.
  11. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    The compiler could not find a definition for the variable: in
    Where was in defined? You must define all variables before using them.
  12. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    Please copy and paste here the full text of the error messages. Sorry, I can't see your computer or its highlighting.
    Here is a sample of an error message from the javac compiler:

    ...
  13. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    Every java file you submit to the compiler must be syntactically correct to get a clean compile.
    I don't know about the technique of commenting out sections of a program that does not compile. I'd...
  14. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    Don't be discouraged about your son's progress. It is possible that his brain doesn't work the way a programmer's brain works. Not everyone can easily learn programming. I see a couple of students...
  15. Replies
    48
    Views
    4,676

    Re: Java ... I Need Your Help so I Can Help My Son

    Please copy and paste here the full text of the error messages.
    We don't write code for you, you will have to write the code. When you have problems or questions, post them.

    Also posted at:...
Results 1 to 15 of 15