CJCoding With Joseph

Two Properties, One Field

Create a class Temperature backed by a private double celsius. A Celsius property reads and writes that field. A read-only Fahrenheit property returns celsius * 9 / 5 + 32. Do not write a Main method.

After setting Celsius to 100, the program prints the Fahrenheit value:
212

Expected Output:

212
Topics:
Encapsulation
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.