import 'dart:io'; void main() { // ????? ???? ????? ???? ????? const int minTemp = 15; const int maxTemp = 30; // ????? ?????????? ??????? bool lightsOn = false; int thermostat = 20; bool securityArmed = false; print("Welcome to the Smart Home System!"); // ???? ?????? ??? ????? ???????? ?????? while (true) { print("\nPlease choose 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(); if (choice == null) continue; switch (choice) { case '1': // ????? ???? ??????? lightsOn = !lightsOn; print("Lights are now ${lightsOn ? 'ON' : 'OFF'}."); break; case '2': // ??? ???? ??????? stdout.write("Set thermostat temperature ($minTemp°C - $maxTemp°C): "); String? tempInput = stdin.readLineSync(); int? newTemp = int.tryParse(tempInput ?? ""); if (newTemp == null) { print("Invalid input! Please enter a number."); } else if (newTemp < minTemp || newTemp > maxTemp) { print("Temperature must be between $minTemp°C and $maxTemp°C."); } else { thermostat = newTemp; print("Thermostat set to $thermostat°C."); } break; case '3': // ????? ???? ?????? ?????? securityArmed = !securityArmed; print("Security system is now ${securityArmed ? 'ARMED' : 'DISARMED'}."); break; case '4': // ??? ???? ?????? ??????? print("\nSystem Status:"); print("- Lights: ${lightsOn ? 'ON' : 'OFF'}"); // ????? ???? FizzBuzz ??? ???? ??????? if (thermostat % 3 == 0 && thermostat % 5 == 0) { print("- Thermostat: $thermostat°C Perfect Day"); } else if (thermostat % 3 == 0) { print("- Thermostat: $thermostat°C Cool Day"); } else if (thermostat % 5 == 0) { print("- Thermostat: $thermostat°C Warm Day"); } else { print("- Thermostat: $thermostat°C"); } // ????? ???? ?????? ?????? ????? ????? String securityStatus = securityArmed ? "ARMED" : "DISARMED"; print("- Security System: $securityStatus"); break; case '5': print("Exiting the system. Goodbye!"); return; default: print("Invalid choice. Please try again."); } } } /* Example Run (Different from the example in the question): Welcome to the Smart Home System! Please choose an action: 1. Toggle lights 2. Set thermostat temperature 3. Arm / disarm security system 4. View system status 5. Exit Enter your choice: 1 Lights are now ON. Enter your choice: 2 Set thermostat temperature (15°C - 30°C): 18 Thermostat set to 18°C. Enter your choice: 3 Security system is now ARMED. Enter your choice: 4 System Status: - Lights: ON - Thermostat: 18°C Cool Day - Security System: ARMED Enter your choice: 2 Set thermostat temperature (15°C - 30°C): 25 Thermostat set to 25°C. Enter your choice: 4 System Status: - Lights: ON - Thermostat: 25°C Warm Day - Security System: ARMED Enter your choice: 5 Exiting the system. Goodbye! */