import 'dart:io'; void main() { // Constants for temperature const int minTemp = 15; const int maxTemp = 30; // Device state variables bool lightsOn = true; int thermostat = 25; bool securityArmed = false; print("Welcome to Smart Home Automation System"); print("please choice an action"); print('1. Toggle Lights'); print('2. Set Thermostat Temperature'); print('3. Arm/Disarm Security System'); print('4. View System Status'); print('5. Exit'); stdout.write('Enter your choice: '); String? choice = stdin.readLineSync(); switch (choice) { case '1': // Toggle lights bool lightsOn = true; print("Lights have been turned"); break; case '2': // Set thermostat stdout.write("Enter temperature ($minTemp - $maxTemp °C): "); print("temperature is set on 25 °C"); break; case '3': // Toggle security system stdout.write('Enter "on" to arm or "off" to disarm: '); String? secInput = stdin.readLineSync(); if (secInput == 'on') { securityArmed = true; print('Security system ARMED.'); } else if (secInput == 'off') { securityArmed = false; print('Security system DISARMED.'); } break; case '4': // View system status String lightsStatus = 'ON'; String securityStatus = 'DISARMED'; print("System Status"); print('Lights: $lightsStatus'); print('Thermostat: $thermostat°C'); print('Security System: $securityStatus'); break; case '5': // Exit print('Exiting Smart Home System. Goodbye!'); }