Answer to Question #312046 in Java | JSP | JSF for aqilah

Question #312046

Write a class to convert Fahrenheit temperature to Celsius. Declare a variable to hold the normal human body temperature of 98.6 degrees Fahrenheit. A Celsius temperature can be calculated by subtracting 32 from the Fahrenheit value and multiplying the result by 5.0/9.0. Display the converted Celsius value. Save the class as FahrenheitToCelsius.java. 



1
Expert's answer
2022-03-16T07:08:03-0400


public class FahrenheitToCelsius {


	/** Main Method */
	public static void main(String[] args) {
		double fahrenheit = 98.6;
		double celsius = (fahrenheit - 32.0) * (5.0 / 9.0);
		System.out.println("The normal human body temperature of 98.6 degrees Fahrenheit");
		System.out.printf("The normal human body temperature of %.2f degrees Celsius\n", celsius);
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

secret
16.03.22, 15:26

thankyou for the answer

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS