import 'dart:io'; void main() { List> incomeList = []; List> expenseList = []; while (true) { print("\nWelcome to the Budget Management Application!"); print("1. Add income"); print("2. Add expense"); print("3. View summary"); print("4. Exit"); stdout.write("Enter your choice: "); String? choice = stdin.readLineSync(); if (choice == "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) { print("Invalid amount!"); } else { incomeList.add({ "description": desc, "amount": amount }); print("Income added!"); } } else if (choice == "2") { stdout . write("Enter expense description: "); String? desc = stdinn.readLineSync(); stdout .write("Enter expense amount: "); double? amount = double . try Parse(stdin .read Line Sync() ?? ""); if (amount == null || amount < 0) { print("Invalid amount!"); } else { expense List .add ({ "description": desc, "amount": amount }); print("Expense added!"); } } else if (choice == "3") { double total Income = 0; double total Expenses = 0; for (var income in income List) { total Income += income["amount"]; } for (var expense in expense List) { total Expenses += expense["amount"]; } double net = total Income - total Expenses; print("\summary:"); print("Total income: \$${total Income}"); print("Total expenses: \$${total Expenses}"); if (net >= 0) { print("Net profit: \$${net}"); } else { print("Net loss: \$${net. Abs()}"); } } else if (choice == "4") { print("Exiting the application. Goodbye!"); break; } else { print("Invalid choice!"); } } }