Night watch and motion magic

Report a typo

A home security system needs to be activated under specific conditions. Can you fill in the blanks in the code to make the security system work correctly? The system should be active when the door is open at night or when motion is detected.

Fill in the gaps with the relevant elements
 isSecuritySystemActive(isDoorOpen: , isNighttime: Boolean, isMotionDetected: Boolean): Boolean {
     doorAndNightCondition = isDoorOpen && isNighttime
    val systemActive = doorAndNightCondition || isMotionDetected
    println("Security System Active: $systemActive")
    return systemActive
}

Create a free account to access the full topic