The formula for converting a temperature from Fahrenheit to Celsius is C = 5/9(F
ID: 3632330 • Letter: T
Question
The formula for converting a temperature from Fahrenheit to Celsius isC = 5/9(F-32)
where F is the Fahrenheit temperarure 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, converted to Celsius. Demonstrate the function by calling it in a loop that displays a table of the Fahrenheit temperatures 0 rhrough 20 and their Celsius equivalents.
Use Void function to complete the Temperature Conversion program
Explanation / Answer
public class Celsius {
public static void main(String[] args) {
for (int i=0; i<21; i++) {
float f =((i*9/5)+32);
System.out.println("Celcius tempperature "+i +
" converted to Fahrenheit : "+f);
}
}
}
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.