package com.codegym.task.task01.task0130;
/*
Our first converter!
*/
public class Solution {
public static void main(String[] args) {
System.out.println(convertCelsiusToFahrenheit(41));
}
public static double convertCelsiusToFahrenheit(int celsius) {
double F;
F = 9/5.0*celsius+32;
System.out.println(F);
return 0;
}
}
what is wrong with my code.I cannot meet one of the conditons that is 3. The convertCelsiusToFahrenheit method should not display anything.
Resolved
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
14 March 2019, 13:57
line 16 fails the condition "The convertCelsiusToFahrenheit method should not display anything."
line 17 should return F and not 0, this is why the last condition is failing "The convertCelsiusToFahrenheit method must correctly convert degrees Celsius to degrees Fahrenheit and return the result."
+1
AJITA SINGH
14 March 2019, 15:38
why does line 16 fail the condition?can you please specify, it would be really helpful
0
Guadalupe Gagnon
14 March 2019, 16:17solution
it specifically says the method should not display anything. line 16 is displaying F
+2