โœ…Computed Properties & ValidationWORKSHOP
1
2
3
4
5

Step 1

Create a `Temperature` class that stores the temperature in Celsius internally (`_celsius`). Add a `celsius` property with a getter and setter (setter validates: must be >= -273.15). Add a `fahrenheit` read-only computed property that converts Celsius to Fahrenheit (`F = C * 9/5 + 32`). Show that changing `celsius` automatically changes `fahrenheit`.

โŒ˜ Enter (Mac) ยท Ctrl+Enter (Win/Linux)