public class Solution
{
public static void main(String[] args)
{
System.out.println(convertCelsiusToFahrenheit(41));
}
public static double convertCelsiusToFahrenheit(int celsius)
{
double TF=(double))(celsius)*9/5)+32;
return TF;
}
}
plz help me
Under discussion
Comments (7)
- Popular
- New
- Old
You must be signed in to leave a comment
sneha
25 February 2019, 10:14
your method would work bt you have missing ( and once check your equation.
double TF=((double)(celsius)*9/5.0)+32;
0
carlos oliveira
20 February 2019, 09:32
declare only one variable double e.g. TF , the formula is " 9 / 5 * celsius + 32. return the result.
remember math order operation ( celsius) * 9 / 5 + 32 is 9 / 5 * celsius + 32. :)
0
Jeff Lamb
17 February 2019, 23:57
Your method would work but you have ( missing. If you check your your equation's () it will work.
0
Himanshu Pal
31 August 2018, 07:43
(double))(celsius)*9/5)+32;
remove ()
(double) celsius ...
this is ok
0
Artem Divertitto Senior Android Developer at United Tech
22 August 2018, 13:27
Try remove all round brackets. And use 5.0 instead 5.
0
Mark Harold Atabelo
21 August 2018, 05:45
delete that double in celsius.
double TF;
TF = ...;
return TF;
0
Tumelo Mohlala
21 August 2018, 05:33
I'm not sure what you need help with, check that you have same number of opening and closing brackets...
+3