Question: JAVA - Define a private helper method called convertToCelsius ( ) that converts the field fahrenheit to Celsius and returns a double. Ex: If the
JAVA
Define a private helper method called convertToCelsius that converts the field fahrenheit to Celsius and returns a double.
Ex: If the input is then the output is:
degrees Celsius
Note: The equation to convert from Fahrenheit to Celsius is: celsius fahrenheit
public class Weather
private double fahrenheit;
public void setFahrenheitdouble inputFahrenheit
fahrenheit inputFahrenheit;
public double getFahrenheit
return fahrenheit;
Your code goes here
public void printInCelsius
System.out.printff degrees Celsius
convertToCelsius;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
