import 'dart:io'; void main() { bool isLightsOn = false; int thermostatTemp = 20; bool isSecurityArmed = false; While (true) { print("\n Welcom to the Smart Home System!"); print("1.Light|2.Thermostat|3.Security system|4.Status|5.Exit"); stdout.write("Enter your choice: "); string? choice = stdin.readLineSync(); } switch (choice) { case "1": isLightsOn = !isLightsOn; // print("Light are now on. "); break; case "2": stdout.write("Set thermostat temprature (15C - 30C): "); int? input = int.tryParse(stdin.readLineSync() ?? ""); if (input != null && input >= 15 && input <= 30) { thermostatTemp = input; print("Modified successfully."); } else { print("Wrong!value shoulde be (15C - 30C )."); } break; case "3": isSecurityArmed = ! print("The status of the security system has changed"); break; case "4": string lightText = (isLightsOn? "ON":"OFF").toUpperCase(); string securityText = (isSecurityArmed? "ARMED":"DISARMED").toUpperCase(); string note = ""; if (thermostatTemp %3 == 0 && thermostatTemp %5 == 0){ note = "- Perfect Day!"; } else if (thermostatTemp %3 == 0){ note = "- Cool Day"; } else if (thermostatTemp %5 == 0){ note = "- Warm Day"; } print("\nSystem Status:"); print("Light:&lightText"); print("temp:$thermostatTempC$note"); print("Security:$securityText"); break; case "5": exit(0); default: print("Exiting the system. "); } }