Question: public class Main { public static void main ( String [ ] args ) { / / print the fahrenheit equivalent of 1 0 0

public class Main{
public static void main(String[] args){
// print the fahrenheit equivalent of 100
System.out.println(celsiusToFahrenheit(100));
}
/*creat a method names as celsiusToFahrenheit which takes the input as celsius temperature as double*/
public static double celsiusToFahrenheit(double celsius){
double fahrenheit;
fahrenheit =((celsius*9)/5)+32; // formula for converting celsius to fahrenheit
return fahrenheit; // return the calculated value of fahrenheit
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!