โ Back to Classes
Question 60
Temperature Equality (operator==)
Temperature Equality (operator==)
You are comparing temperatures for a thermostat. Create a class Temperature that stores degrees Celsius as an int. Requirements: 1) Constructor Temperature(int c) 2) int getC() const 3) Overload operator== to compare if two Temperature objects have the same Celsius value Do NOT write a main function.
Expected Output:
equal not equal
Topics:
ClassesOperator Overloading
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.