Answer:
// program in java.
//package
import java.util.*;
// class definition
class Main
{
// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
System.out.println("Fahrenheit \t celsius :");
// print the temperature in Fahrenheit and equivalent celsius
for(double f=-40;f<=120;f=f+5)
{
// convert Fahrenheit to equivalent celsius
double cel=((f-32)*5)/9;
// print the values
System.out.printf("%.2f \t %.2f \\", f, cel);
}
}catch(Exception ex){
return;}
}
}
Step-by-step explanation:
Run a loop from -40 to 120.To convert a temperature from Fahrenheit to equivalent celsius we use formula cel=(f-32)5/9.This will convert the temperature from Fahrenheit to celsius.increment 5 in Fahrenheit temperature and convert it to celsius till it reaches to 120.
Output:
Fahrenheit celsius :
-40.00 -40.00
-35.00 -37.22
-30.00 -34.44
.
.
.
110.00 43.33
115.00 46.11
120.00 48.89