Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    New topic: comparing the contents of objects. Strings are objects. If you want to compare the contents of two objects you need to use the equals() method:
    myPassword.equals( "XRay" )
  2. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    Please be more specific and not use words like this and it. I can't read your mind.
  3. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    What are you trying to do in the if statement?

    if ( s == XRay )
  4. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    Where is the variable named: Xray defined? The compiler can not find its definition.
    Also see post #16
  5. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    Where is the variable named: Xray defined? The compiler can not find its definition.
  6. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    If you had made either of the changes you should get a different error.
    Please post the new code and the full text of the error messages.
  7. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    The last line of your post encloses the s in "s "s"

    This line defines the variable: thePassword as a boolean variable

    boolean thePassword

    What text are you using to learn java? These...
  8. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    Is Xray the name of a variable? If so you need to define it and give it a value.
    Or did you want it to be a String? If so enclose it in "s.
  9. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    Take a look at these:
    Equality, Relational, and Conditional Operators (The Java™ Tutorials > Learning the Java Language > Language Basics)
    The if-then and if-then-else Statements (The Java™...
  10. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    You are using the assignment operator (=) instead of the comparsion operator (==).
    The value returned by an assignment is what is to the left of the =.
    An if statement requires a boolean value,...
  11. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    Can you explain the problem?
  12. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    If you take out the case for M, S or D you will also get the same thing when you enter an 'a'. The code for those other letters is not being used when you enter an 'a'.

    Try entering an e (instead...
  13. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    Can you explain what is wrong with what the program did when you executed it?
    The output looks like the program did what it was supposed to do.
  14. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    Can you post the contents of the console window that shows what you are talking about?

    On windows: To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select...
  15. Thread: Math.pow

    by Norm
    Replies
    30
    Views
    3,536

    Re: Math.pow

    Can you explain the problem? Are you getting error messages? Please copy and paste the full text here.

    Please Edit your post and wrap your code with


    <YOUR CODE HERE>

    to get highlighting...
Results 1 to 15 of 15