void main() { List> incomeList = [ {"Sales": 5000}, {"Investment": 2000} ]; List> expenseList = [ {"Rent": 3000}, {"Salaries": 2500} ]; double totalIncome = 0; double totalExpense = 0; for (var item in incomeList) { totalIncome += item.values.first; } for (var item in expenseList) { totalExpense += item.values.first; } double net = totalIncome - totalExpense; print("Total Income: \$${totalIncome}"); print("Total Expenses: \$${totalExpense}"); if (net >= 0) { print("Your net profit is \$${net}"); double tax = net > 0 ? net * 0.15 : 0; print("Tax to pay (15%): \$${tax}"); } else { print("Your net loss is \$${net.abs()}"); } }