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...
Type: Posts; User: Norm
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...
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...
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.
That's strange. I expected it to be 1.0?
Can you post the code and the code you used to print it?
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.
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.
See the printf() method
or the DecimalFormat class
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...
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...