import 'dart:io'; void main(){ // default values bool lightsOn = false; int thermostat = 20; bool securityArmed = false; const int minTemp = 15; const int maxTemp = 30; while(true){ int choice = int.parse(stdin.readLineSync()!); if(choice == 1){ lightsOn = !lightsOn; print("Lights are now ${lightsOn ? "ON" : "OFF"}"); } else if(choice == 2){ int temp = int.parse(stdin.readLineSync()!); if(temp >= minTemp && temp <= maxTemp){ thermostat = temp; print("Thermostat set to $thermostat°C"); } else { print("Invalid temperature"); } } else if(choice == 3){ securityArmed = !securityArmed; print("Security System: ${(securityArmed ? "armed" : "disarmed").toUpperCase()}"); } else if(choice == 4){ String mood = ""; if(thermostat % 3 == 0 && thermostat % 5 == 0){ mood = "Perfect Day"; } else if(thermostat % 5 == 0){ mood = "Warm Day"; } else if(thermostat % 3 == 0){ mood = "Cool Day"; } else{ mood = "Normal Day"; } print("Lights: ${lightsOn ? "ON" : "OFF"}"); print("Thermostat: $thermostat°C - $mood"); print("Security System: ${(securityArmed ? "armed" : "disarmed").toUpperCase()}"); } else if(choice == 5){ break; } } }