← Back to Classes
Question 486
Degrees In Celsius
Degrees In Celsius
A Temperature stores fahrenheit as a float. Write the body of to_celsius so it returns the same temperature in Celsius: subtract 32 first, then multiply by 5 and divide by 9. Do NOT write a main block or any top-level test code; the tests construct the class. Input: one line, the Fahrenheit value, which the tests read as a float and pass to the constructor before printing the Celsius value your method returns.
Expected Output:
100.0= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Classes
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.