Our first converter!

  • 7
  • Locked
You've probably used electronic converters or programs on many occasions to convert a quantity of one unit to a quantity of another unit. For example, dollars to pounds, or kilometers to miles. Now it's time for us to write such a tool. Specifically, we'll write a program that converts from degrees Celsius to degrees Fahrenheit.
You can't complete this task, because you're not signed in.
Comments (97)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Anonymous #11031355
Level 2 , San Francisco, United States
8 July, 12:42
(9.0 / 5) * celsius + 32 & (9 / 5.0) * celsius + 32 不然9/5是int类型
Anonymous #10830582
Level 2 , Portugal
28 December 2021, 07:34
double fahrenheit = (1.8 * celsius) + 32; return fahrenheit;
Anonymous #10830582
Level 2 , Portugal
28 December 2021, 07:31
one must return ' return fahrenheit; NOT 'return 0;' GOOD LUCK
Level 2 , United States of America
25 October 2021, 16:36
the decimal thing was strange, it reminds me of significant figures rules. the return issue was interesting bc it stuck out to me, but a few tries landed me with 'what should I tell it to return if this method is called' (not sure if that is the correct thinking, but it worked.) A little confused as to declaration of convertCelsiusToFahrenheit as it seems to do that within the creation of the composite type convertCelsiusToFahrenheit right after public static. the compiler didn't seem to like it if I didn't declare convertCelsiusToFahrenheit in the body. What is going on?...celcius seems fine as int..
Anonymous #10829459
Level 2 , Spain
8 October 2021, 15:31
quede cabezona
Erick Gonzalez.
Level 3 , Mexico, Mexico
24 August 2021, 02:51
yo saque' el resultado con otro metodo, pero no me lo tomo' como bueno, porque tenia que llamar al metodo. muy buen ejercicio.
Anonymous #10762391
Level 2 , Germany
17 August 2021, 13:41
In which lesson does it explain the variables double and return? Did I miss something? Im losing my mind!
5 August 2021, 12:53
tough one, the decimals got me good,but still really instructive.
David Vidal
Level 2
1 June 2021, 13:33
I do not understand why the value assignation ignores "(9 / 5)" part. If I put 1.8 (the result of 9/5) It works fine!
Yusuf el Turki
Level 5 , Rhein, Germany
16 May 2021, 20:57
Ich habe die richtige Antwort (105.8) aber trotzdem hatte ich Warnungen. Also sei vorsichtig die vierte Besonderheit. Benutzen sie das result command richtig.