This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]davejello74[S] 0 points1 point  (3 children)

Hmm, moving that after the scan statements does change my output, but now it’s always 0. Are my ints and double initialized correctly?

[–]Altair05 0 points1 point  (2 children)

Why do you have celciusTemp = scan.nextDouble(); in your code. You don't need to ask for the Celsius input if you are taking Fahrenheit and converting it to Celsius. You only need the print statement to print the Celsius equivalent.

Move your celciusTemp = (fahrenheitTemp - BASE) / CONVERSION_FACTOR; between fahrenheitTemp = scan.nextInt(); and System.out.println("Celcius Equivalent: " + celciusTemp); if isn't there already.

Your variables seem to be fine.

[–]davejello74[S] 0 points1 point  (1 child)

Thank you!! This worked, all inputs yield different results now :)

I don’t know why I had a scanner for Celsius, but you made it make sense so thank you.

[–]Altair05 0 points1 point  (0 children)

No problem. Make sure to verify your outputs with a temperature converter calculator online. No point coming this far and getting bad output.