Dart Assignment Smart Home System (Dart Code) import ‘dart:io’; void main() { const int minTemp = 15; const int maxTemp = 30; bool lightsOn = false; int thermostat = 20; bool securityArmed = false; while (true) { print(“Home System”); print(“1. Toggle Lights”); print(“2. Set Thermostat”); print(“3. Arm/Disarm Security System”); print(“4. View System Status”); print(“5. Exit”); stdout.write("Enter your choice: "); int choice = int.parse(stdin.readLineSync()!); if (choice == 1) { lightsOn = !lightsOn; print(lightsOn ? "Lights turned ON" : "Lights turned OFF"); } else if (choice == 2) { stdout.write("Enter temperature ($minTemp - $maxTemp): "); int temp = int.parse(stdin.readLineSync()!); if (temp >= minTemp && temp <= maxTemp) { thermostat = temp; print("Temperature set to $thermostat°C"); } else { print("Invalid temperature."); } } else if (choice == 3) { securityArmed = !securityArmed; print(securityArmed ? "Security System ARMED" : "Security System DISARMED"); } else if (choice == 4) { String lightStatus = lightsOn ? "ON" : "OFF"; String securityStatus = securityArmed ? "ARMED" : "DISARMED"; print("\nSystem Status:"); print("Lights: $lightStatus"); print("Thermostat: $thermostat°C"); print("Security System: $securityStatus"); } else if (choice == 5) { print("Exiting system..."); break; } else { print("Invalid choice"); } } } Budget Management Application (Dart Code) import ‘dart:io’; void main() { List> incomeList = []; List> expenseList = []; while (true) { print("\nBudget Management System"); print("1. Add Income"); print("2. Add Expense"); print("3. View Summary"); print("4. Exit"); stdout.write("Enter your choice: "); int choice = int.parse(stdin.readLineSync()!); if (choice == 1) { stdout.write("Enter income description: "); String desc = stdin.readLineSync()!; stdout.write("Enter income amount: "); double amount = double.parse(stdin.readLineSync()!); if (amount > 0) { incomeList.add({"description": desc, "amount": amount}); print("Income added successfully."); } } else if (choice == 2) { stdout.write("Enter expense description: "); String desc = stdin.readLineSync()!; stdout.write("Enter expense amount: "); double amount = double.parse(stdin.readLineSync()!); if (amount > 0) { expenseList.add({"description": desc, "amount": amount}); print("Expense added successfully."); } } else if (choice == 3) { double totalIncome = 0; double totalExpense = 0; for (var item in incomeList) { totalIncome += item["amount"]; } for (var item in expenseList) { totalExpense += item["amount"]; } double net = totalIncome - totalExpense; print("\nSummary:"); print("Total Income: $totalIncome"); print("Total Expenses: $totalExpense"); if (net >= 0) { print("Your net profit is $net"); double tax = net * 0.15; print("Tax to be paid (15%): $tax"); } else { print("Your net loss is ${net.abs()}"); } } else if (choice == 4) { print("Exiting program..."); break; } } }