Home, sweet automated home

Report a typo
Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!
Create a SmartHome class that can control the temperature and lock status of a home. The class should have properties for the home's name, temperature, and lock status, and methods to adjust the temperature and toggle the lock. Fill in the blanks to complete the class definition.
Fill in the gaps with the relevant elements
 SmartHome( name: String,  temperature: Int, var isLocked: Boolean) {
     adjustTemperature(newTemp: Int) {
        temperature = newTemp
        ("Temperature in $name set to $temperature°C")
    }
    fun toggleLock() {
        isLocked = !isLocked
        println("$name is now ${if (isLocked) "locked" else "unlocked"}")
    }
}
constprintlnvalvarclassprintfunletprocstruct

Create a free account to access the full topic