Write a class that contains the following two methods:
/** Converts from Celsius to Fahrenheit */
Hello there guys please I need help with this program in java
this what i have done so far , please any help would much appreciated
Thanks.
< public class EX5_8{
public static void main(String args[]){
/* public static double celsiusToFahrenheit(double celsius){
return celsius=(5.0/9.0) * fahrenheit - 32;
}
public static double fahrenheitToCelsius(double fahrenheit){
return fahrenheit=(9.0/5.0) * fahrenheit + 32;
}*/
System.out.println("|Celsius |Fahrenheit||Celsius |Fahrenheit| \n");
int i=40;
int j=120;
do{
System.out.printf("%3.1f|%11.1f|%3.1f|%8.2f|\n",i, (i*(9.0/5)+32),j,(j/i*(5.0/9)-32));
i-=1;
j-=10;
}while(i<=31 && j<=30);
}
}
>
Find below is the complete question
public static double celsiusToFahrenheit(double celsius)
/** Converts from Fahrenheit to Celsius */
public static double fahrenheitToCelsius(double fahrenheit)
The formula for the conversion is:
fahrenheit = (9.0 / 5) * celsius + 32
Write a test program that invokes these methods to display the following tables:
Celsius Fahrenheit Fahrenheit Celsius
40.0 104.0 120.0 48.89
39.0 102.2 110.0 43.33
...
32.0 89.6 40.0 4.44
31.0 87.8 30.0 -1.11
Edit / Delete