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 (91)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Erick Gonzalez.
Level 3 , Mexico, Mexico
24 August, 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, 13:41
In which lesson does it explain the variables double and return? Did I miss something? Im losing my mind!
5 August, 12:53
tough one, the decimals got me good,but still really instructive.
David Vidal
Level 2
1 June, 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, 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.
Teodor Oprean
Level 2 , Timisoara, Romania
5 April, 12:55
First of all, you need to understand that the people behind the CodeGym platform want us to learn and find answers on our own not to use everything we have learned on their site! It is not a bad thing because they simulate real-world problems where you do not always know how to solve the task 100%. So keep learning and you will know how to solve the task! 😀
AlasCaras
Level 4 , Corpus Christi, United States
6 February, 04:13
you replace TF by fahrenheit, you replace return 0 by return fahrenheit, you replace 9/5 by 9/5.0, you replace TC by celsius and bingo!!!!!
Seth Barker
Level 5 , Eureka Springs, United States
2 January, 19:18
I'm getting the correct answer but I'm still missing one of the requirements and I can't figure out what the issue is. Here's the requirement I'm not meeting: "The convertCelsiusToFahrenheit method must correctly convert degrees Celsius to degrees Fahrenheit and return the result."
Roman
Level 41
4 January, 09:07
Please post your question with the attached solution in the section Help.
JF
Level 9
9 July, 07:26
It is possible that you're doing everything using integers and thus 9/5=1 not 1.8. You need to use doubles.
Mario Pacios Martínez
Level 3 , Ponferrada
21 November 2020, 15:13
I don't understand why the dot is used
8 December 2020, 04:00
This is because you're returning a double. Same happens if you put the dot next to 9. Hope it helps
Anitamalina
Level 13 , København, Denmark
25 September 2020, 06:21
I'm just wondering why 32 doesn't have to be of the type double, when 9.0 and 5.0 has?
JF
Level 9
9 July, 07:29
When you divide int by an int, the resulting fractional part is cut - 9/5=1. When you add an int, you don't lose anything in the process.