I have no idea what this is asking for. It gives an example, but it doesn't state a question clearly. What am I supposed to be accomplishing here?
The convertCelsiusToFahrenheit(int celsius) method accepts a value in degrees Celsius. The method should convert the temperature and return the value in degrees Fahrenheit.
The Celsius temperature (TC) and the Fahrenheit temperature (TF) are related by the following relationship:
TC = (TF - 32) * 5/9.
Consider this example:
A value of 41 is passed to the convertCelsiusToFahrenheit method.
Example output:
105.8
Requirements:
1. The convertCelsiusToFahrenheit(int) method must be public and static.
2. The convertCelsiusToFahrenheit method must return a double.
3. The convertCelsiusToFahrenheit method should not display anything.
4. The convertCelsiusToFahrenheit method must correctly convert degrees Celsius to degrees Fahrenheit and return the result.
What is the "Converter" question asking for?
Resolved
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Andrew
3 April 2019, 20:04solution
This task is asking you to create the body of the method convertCelsiusToFahrenheit() which will take the parameter (an int in temperature Celsius) and return that equivalent temperature in Fahrenheit. You need to come up with the process for the conversion. For example, 0 deg Celsius (freezing) is the same as 32 deg Fahrenheit (freezing), so when calling convertCelsiusToFahrenheit(0) the output should be 32.
The equation given in the task description is for converting Fahrenheit to Celsius which is the opposite of what we want. Google or do the math to get the appropriate equation for Celsius to Fahrenheit.
Hope that makes it more clear.
+9
Za Surpex
3 April 2019, 20:13
Makes much more sense. Thanks a lot!
0
Will Irvin
12 April 2019, 03:57
Thanks for the insight Andrew, you rock!
0