5.2 Java. Create a new class called Temperature (with no mainmethod), and include the following methods inside it instead:
- A method to convert the temperature from Celcius to Fahrenheit.Formula: (0°C × 9/5) + 32 =32°F
- A method to convert the temperature from Fahrenheit to Celcius.Formula: (32°F − 32) × 5/9 =0°C
For both of these methods, they should take 1 parameter, andreturn a value
Then create a class called Demo, which does include the mainmethod, and test out both of your methods from the Temperatureclass
Solution
public class Temparature { public double ctoF(double c){ return (c *9 /5) + 32;
OR
OR