Computer Science, asked by nafisha19, 8 months ago

write a class named display which call a function convert to another class named temperature the function takes celsius temperature as argument and then returns the equivalent Fahrenheit given below Fahrenheit =18* calsius +32.0​

Answers

Answered by sanjiththesupernigha
0

Answer:

1

2

3

4

5

6

7

8

import java.util.Scanner;

class FahrenheittoCelsius

{

public static void main(String arg[])  

{

    double a,c;

                 Scanner sc=new Scanner(System.in);      

    System.out.println("Enter  Fahrenheit temperature");

                  a=sc.nextDouble();  

    System.out.println("Celsius temperature is = "+celsius(a));              

}  

static double celsius(double f)

{  

return  (f-32)*5/9;

}

}

Explanation:

Similar questions