import 'dart:io'; void main(){ bool lightState = false; int tempValue = 20; bool alarmState = false; const int low = 15; const int high = 30; while(true){ int option = int.parse(stdin.readLineSync()!); if(option == 1){ if(lightState == false){ lightState = true; } else { lightState = false; } print("Lights: ${lightState ? "ON" : "OFF"}"); } else if(option == 2){ int newTemp = int.parse(stdin.readLineSync()!); if(newTemp < low || newTemp > high){ print("Temperature not allowed"); } else { tempValue = newTemp; print("Temperature updated to $tempValue°C"); } } else if(option == 3){ alarmState = alarmState == true ? false : true; String status = alarmState ? "ARMED" : "DISARMED"; print("Alarm status: $status"); } else if(option == 4){ String dayType; if(tempValue % 15 == 0){ dayType = "Perfect Day"; } else if(tempValue % 5 == 0){ dayType = "Warm Day"; } else if(tempValue % 3 == 0){ dayType = "Cool Day"; } else{ dayType = "Normal Day"; } print("Lights status: ${lightState ? "ON" : "OFF"}"); print("Thermostat: $tempValue°C - $dayType"); print("Security: ${alarmState ? "ARMED" : "DISARMED"}"); } else if(option == 5){ break; } } }