import 'dart:io'; void main(){ String lights ="OFF"; int thermostat =20 ; String security ="DISADRMED"; const minTemp = 15; const maxTemp = 30; bool running = true ; while (running){ print("--welcom to the smart home system--"); print("please choose an action :"); print("1.Toggle lights"); print("2.set thermostat tempreature"); print("3.Arm/Disarmed security system"); print("4.view system status"); print("5. Exit"); print ("enter your choice:"); String? choice = stdin.readLineSync(); switch (choice){ case "1": lights =(lights=="off")?" on" : "off"; print ("lights are now $lights"); case "2": print ("enter tempreature($minTemp-$maxTemp:)"); int? tempr = int .tryParse(stdin.readLineSync()!); if (tempr!=null && tempr >= 15 && tempr <=30 ){ thermostat = tempr ; print ("thermostatset to $thermostat"); }else { print("Invalid tempreature!"); } case "3": security =(security=="DISARMED")? "ARMED" : "DISARMED"; print("securi System isnow $security"); break; case "4" : void main(){ String daytype = ""; if (thermostat % 3 == 0 && thermostat % 5 == 0){ daytype = "perfect day"; } else if (thermostat % 3 ==0){ daytype ="Cool day"; }else if (thermostat %5 ==0){ daytype ="warm day"; } } break; case "5": print ("goodbye"); running = false ; break; default: print("Invalid choice! please try again."); } } }