public class Solution {
public static void main(String[] args) {
System.out.println(convertCelsiusToFahrenheit(41));
}
public static double convertCelsiusToFahrenheit(int celsius) {
TC = (TF - 32) * 5/9;
return 0;
}
}
I have no idea ... !!
Please guide :)
Our first converter!
Resolved
Comments (6)
- Popular
- New
- Old
You must be signed in to leave a comment
barbara
28 May 2020, 11:45
Hi! I don't understand, could you explain how it is done :(
0
Srividya
28 September 2018, 08:41
Done !! :) :)
I got the solution :)
0
hidden #10628226
13 June 2020, 00:45
what's is the purpose on this lesson?
0
Srividya
27 September 2018, 18:50
double fahrenheit=(9/5*celsius+32);
double fahrenheit=(9/5.0*celsius+32);
double fahrenheit=(1.8*celsius+32);
double fahrenheit=((9/5.0*celsius)+32);
double fahrenheit=(celsius*9/5+32);
I tried all of the above .....
It is still incorrect !!
0
Ankush Rajput
27 September 2018, 19:10
Only the first and last expressions won't work as 9/5 evaluates to integer and not double. Rest all are working fine. Are you returning fahrenheit after calculation ? You should return fahrenheit value and not 0.
+1
Ankush Rajput
27 September 2018, 18:03
Celcius is given to you in function, declare a variable to store farenheit values. Some how calculate farenheit value using formula and then return farenheit value.
Its basic arithmetic and implementation problem. Try. You'll get it.
+1