Write a class that contains the following two methods:
/** Convert from Celsius to Fahrenheit */
public static double celsiusToFahrenheit(double celsius)
/** Convert from Fahrenheit to Celsius */
public static double fahrenheitToCelsius(double fahrenheit)
The formula for the conversion is:
fahrenheit = (9.0 / 5) * celsius + 32
celsius = (5.0 / 9) * (fahrenheit – 32)
Write a test program that invokes these methods to display the following tables:
Celsius | Fahrenheit | I | Fahrenheit` | Celsius |
40.0 | 104.0 | I | 120.0 | 48.89 |
39.0 | 102.2 | I | 102.2 | 43.33 |
… |
|
|
|
|
32.0 | 89.6 | I | 40.0 | 4.44 |
31.0 | 87.8 | I | 30.0 | -1.11 |
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.