Hello everyone,
i have a question about the converter task.
I'd like to know if casting the double type like this is another possible way like writing 9/5.0
public static double convertCelsiusToFahrenheit(int celsius) {
//write your code here
double TF = (double)9/5 * celsius + 32;
return TF;
I tried to do it but i already submitted the other answer, so i'm curious to know if this would actually work. Thanks
Question about the converter task
Resolved
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Gellert Varga
3 April 2021, 08:53solution
Here is a very good online IDE compiler, you can always try any program here:
https://www.jdoodle.com/online-java-compiler/
(It has dark theme, too.)
You can try:
+3
Nouser
3 April 2021, 07:48useful
That's possible, too (implicite cast - widening primitive conversion).
+1