=============================== 🏠 SMART HOME AUTOMATION SYSTEM =============================== import 'dart:io'; void main() { const int minTemp = 15; const int maxTemp = 30; bool lightsOn = false; int temperature = 20; bool securityArmed = false; while (true) { print('\n=== SMART HOME SYSTEM ==='); 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('Choose an option: '); String? choice = stdin.readLineSync(); if (choice == '5') { print('Exiting Smart Home System... Goodbye!'); break; } switch (choice) { case '1': lightsOn = !lightsOn; print('Lights are now ${lightsOn ? "ON" : "OFF"}'); break; case '2': stdout.write('Enter temperature ($minTemp-$maxTemp): '); int? temp = int.tryParse(stdin.readLineSync() ?? ''); if (temp != null && temp >= minTemp && temp <= maxTemp) { temperature = temp; print('Thermostat set to $temperature°C'); } else { print('Invalid temperature! Must be between $minTemp and $maxTemp.'); } break; case '3': securityArmed = !securityArmed; print('Security system is now ${securityArmed ? "ARMED" : "DISARMED"}'); break; case '4': String lightsStatus = lightsOn ? "ON" : "OFF"; String secStatus = securityArmed ? "ARMED" : "DISARMED"; String dayType = ''; if (temperature % 3 == 0 && temperature % 5 == 0) { dayType = 'Perfect Day'; } else if (temperature % 3 == 0) { dayType = 'Cool Day'; } else if (temperature % 5 == 0) { dayType = 'Warm Day'; } print('\n--- SYSTEM STATUS ---'); print('Lights: $lightsStatus'); print('Thermostat: $temperature°C ${dayType.isNotEmpty ? "($dayType)" : ""}'); print('Security: ${secStatus.toUpperCase()}'); break; default: print('Invalid choice. Try again.'); } } } =============================== 💰 BUDGET MANAGEMENT APPLICATION =============================== import 'dart:io'; void main() { List> incomeList = []; List> expenseList = []; print('=== WELCOME TO BUDGET MANAGEMENT SYSTEM ==='); while (true) { print('\n1. Add Income'); print('2. Add Expense'); print('3. View Summary'); print('4. Exit'); stdout.write('Choose an option: '); String? choice = stdin.readLineSync(); if (choice == '4') { print('Exiting Budget Management System... Goodbye!'); break; } switch (choice) { case '1': stdout.write('Enter income description: '); String? desc = stdin.readLineSync(); stdout.write('Enter income amount: '); double? amount = double.tryParse(stdin.readLineSync() ?? ''); if (amount != null && amount >= 0) { incomeList.add({desc ?? 'Unnamed Income': amount}); print('Income added successfully!'); } else { print('Invalid amount!'); } break; case '2': stdout.write('Enter expense description: '); String? desc = stdin.readLineSync(); stdout.write('Enter expense amount: '); double? amount = double.tryParse(stdin.readLineSync() ?? ''); if (amount != null && amount >= 0) { expenseList.add({desc ?? 'Unnamed Expense': amount}); print('Expense added successfully!'); } else { print('Invalid amount!'); } break; case '3': double totalIncome = 0; double totalExpenses = 0; for (var entry in incomeList) { totalIncome += entry.values.first; } for (var entry in expenseList) { totalExpenses += entry.values.first; } double net = totalIncome - totalExpenses; print('\n--- BUDGET SUMMARY ---'); print('Total Income: \$${totalIncome.toStringAsFixed(2)}'); print('Total Expenses: \$${totalExpenses.toStringAsFixed(2)}'); if (net >= 0) { print('Your net profit is \$${net.toStringAsFixed(2)}'); double tax = net > 0 ? net * 0.15 : 0; print('Tax to pay (15%): \$${tax.toStringAsFixed(2)}'); } else { print('Your net loss is \$${net.abs().toStringAsFixed(2)}'); } break; default: print('Invalid choice. Try again.'); } } }