Search:

Type: Posts; User: Norm

Search: Search took 0.17 seconds.

  1. Thread: compile error

    by Norm
    Replies
    22
    Views
    1,521

    Re: compile error

    How can the value of f from case 1 be used?

    Executed code uses the values of variables when the code is executed.
    When is the cels() method called? What are the values of c and f when it is...
  2. Thread: compile error

    by Norm
    Replies
    22
    Views
    1,521

    Re: compile error

    Are the equations correct? Check that all the computations are generating the expected values.
    Add some println statements that print out all the intermediate results so you can see where the...
  3. Thread: compile error

    by Norm
    Replies
    22
    Views
    1,521

    Re: compile error

    What you are seeing is the results of integer arithmetic: 9/5 = 1 (no decimal places)
    Change one of the numbers to a double: 9.0/5 and see what you get.
  4. Thread: compile error

    by Norm
    Replies
    22
    Views
    1,521

    Re: compile error

    That's strange. I expected it to be 1.0?
    Can you post the code and the code you used to print it?
  5. Thread: compile error

    by Norm
    Replies
    22
    Views
    1,521

    Re: compile error

    Did you try the tests I suggested in post #13?
    What printed out?

    Print out the value of b in the cels() method to see what its value is.
  6. Thread: compile error

    by Norm
    Replies
    22
    Views
    1,521

    Re: compile error

    Print out the value of this: (9/5) to see what integer arithmetic does.
    Then change one of the numbers to a double and see what is printed.
  7. Thread: compile error

    by Norm
    Replies
    22
    Views
    1,521

    Re: compile error

    See the printf() method
    or the DecimalFormat class
  8. Thread: compile error

    by Norm
    Replies
    22
    Views
    1,521

    Re: compile error

    The compiler wants the variable s to be assigned a value. Can you do that before it is used?


    BTW passing a variable with no meaningful value to a method does not make sense. If you need a...
  9. Thread: compile error

    by Norm
    Replies
    22
    Views
    1,521

    Re: compile error

    Can you copy the console contents and paste it here. The image is too small to see the text,

    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit...
Results 1 to 9 of 9