The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Re: Trouble with fahrenheit to celsius conversion.

...
I did the one about the celsius -> fahrenheit converter, and thought i'd make it on better by adding the other way round

That's a Great Idea! Start with something that works and make changes to make sure you understand what's going on. I like that approach.

Originally Posted by HaHom Tsa Pfnuma

won't work...suggestions

Inspect the statements that control the displayed values. The program does the hard part (getting user input, calculating a result based on that value, and then displaying the result). All you have to do is to make sure the calculations are correct. That's just a matter of math.

Anyhow...

So, the program converts Celsius to Fahrenheit correctly, right? Here's the formula.

DegreesF = DegreesC * 9.0/5.0 + 32.0

Compare it with the program statement that does the conversion. So, far, so good, right?

Re: Trouble with fahrenheit to celsius conversion.

Aha, the missing parenthesisses (if that's how you say it in plural, anyway, heh)!!! I've got to look closer at what i'm doing.

Thanks a lot, especially for the detailed explanation. I really appreciate you taking your time to explain it properly instead of just providing the solution; also gives a nice feeling to actually solve it by myself.