Celcius Temperature Table The formula for converting a temperature from Fahrenhe
ID: 3709438 • Letter: C
Question
Celcius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is C (5/9)* (F-32) Where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named Celsius that accepts a Fahrenheit temperature as an argument. The function should return the temperature as an argument. The function should return the temperature, converted to Celsius Demonstrate the function by calling it in a loop that displays a table of the Fahrenheit temperatures0 through 20 and their Celsius equivalents. Output 0 2 20 ?Explanation / Answer
public class Chegg10
{
public static void main(String[] args)
{
System.out.println(" F C"); //this is the format you are expected
System.out.println("________________________________");
for (double i = 0; i <=20; i++) //this is the format you are expected
{
System.out.println(" "+i+" "+Celsius(i)); //this is the format you are expected
}
}
public static double Celsius(double f) //this is the function that convert Fahrenheit to celsius
{
double c;
c=(f-32)*5; //these are the formula
return c/9;
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.