← Back to Classes
Question 485
Degrees In Fahrenheit
Degrees In Fahrenheit
A Temperature stores celsius as a float. Write the body of to_fahrenheit so it returns the same temperature in Fahrenheit: multiply by 9, divide by 5 and add 32. Do NOT write a main block or any top-level test code; the tests construct the class. Input: one line, the Celsius value, which the tests read as a float, pass to the constructor and use before printing the Fahrenheit value your method returns.
Expected Output:
212.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.