{"id":640,"date":"2024-11-20T06:00:00","date_gmt":"2024-11-20T06:00:00","guid":{"rendered":"https:\/\/farislabs.com\/?page_id=640"},"modified":"2024-11-21T04:40:40","modified_gmt":"2024-11-21T04:40:40","slug":"expense-tracker-app","status":"publish","type":"page","link":"https:\/\/farislabs.com\/index.php\/expense-tracker-app\/","title":{"rendered":"Expense Tracker App"},"content":{"rendered":"\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<h1 class=\"wp-block-heading\">Expense Tracker App<\/h1>\n\n\n\n<p class=\"has-large-font-size\"><strong>&#8220;A tool to monitor daily expenses, manage budgets, and achieve savings goals.&#8221;<\/strong><\/p>\n\n\n\n<p>The <strong>Expense Tracker App<\/strong> is designed to help individuals manage their budgets and track expenses effectively. It provides an intuitive interface for logging expenses, updating income, and setting savings goals.<\/p>\n\n\n\n<p>This project addresses users&#8217; challenges when manually tracking expenses and maintaining a balanced budget.<\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Problem Statement<\/strong><\/h2>\n\n\n\n<p><strong>What Problem Does It Solve?<\/strong><br>Many individuals struggle to monitor their spending and stay within budget, which can lead to financial instability.<\/p>\n\n\n\n<p><strong>How Does It Solve It?<\/strong><br>The Expense Tracker App allows users to log expenses, calculate their remaining budget, and track progress toward their savings goals.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Key Features<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Expense Logging<\/strong>\n<ul class=\"wp-block-list\">\n<li>Users can add expenses by specifying the item name and cost.<\/li>\n\n\n\n<li>Automatically deducts the expense from the remaining budget.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Income Updates<\/strong>\n<ul class=\"wp-block-list\">\n<li>Allows users to update their income and recalculate their budget.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Savings Goal Management<\/strong>\n<ul class=\"wp-block-list\">\n<li>Users can set or adjust their savings goals.<\/li>\n\n\n\n<li>Tracks progress toward achieving savings.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Expense History<\/strong>\n<ul class=\"wp-block-list\">\n<li>Displays all logged expenses with a summary of total spending.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Workflow or User Scenarios<\/strong><\/h2>\n\n\n\n<p><strong>Scenario 1<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The user buys fuel for $60.<\/li>\n\n\n\n<li>Logs the expense as &#8220;fuel&#8221; with the cost of $60.<\/li>\n\n\n\n<li>The app subtracts $60 from the budget and displays the remaining balance and savings goal.<\/li>\n<\/ul>\n\n\n\n<p><strong>Scenario 2<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The user logs another fuel expense of $60.<\/li>\n\n\n\n<li>The total spent on fuel is updated to $120.<\/li>\n\n\n\n<li>The user views all previous expense inputs, which display the total fuel expenses.<\/li>\n<\/ul>\n\n\n\n<p><strong>Scenario 3<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The user adds $6000 to their budget.<\/li>\n\n\n\n<li>The remaining budget will be updated to $ 8,000 while retaining the current savings goal.<\/li>\n<\/ul>\n\n\n\n<p><strong>Scenario 4<\/strong>:<\/p>\n\n\n\n<p>The app updates the savings goal to $3300 and recalculates the remaining budget.<\/p>\n\n\n\n<p>The user increases their savings goal by $3000.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Code Implementation<\/strong><\/h2>\n\n\n\n<p>The code for the Expense Tracker App is written in Python and focuses on handling user inputs, managing financial data, and presenting budget insights.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Initializing User Data<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>user_name = input(\"Enter your name: \")\ntotal_income = float(input(\"Enter your total income: \"))\nsavings_goal = float(input(\"Enter your savings goal: \"))\nexpenses = {}  # Dictionary to store expense history\nremaining_budget = total_income - savings_goal<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Menu System<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>while True:\n    print(\"\\nMenu:\")\n    print(\"1. Add expense\")\n    print(\"2. Add income\")\n    print(\"3. Add additional savings input\")\n    print(\"4. View all previous expense inputs\")\n    print(\"5. Exit\")\n    choice = int(input(\"Enter your choice: \"))<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Logging Expenses<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>if choice == 1:\n    expense_name = input(\"Enter the expense name: \")\n    expense_cost = float(input(\"Enter the expense amount: \"))\n    remaining_budget -= expense_cost\n    expenses&#91;expense_name] = expenses.get(expense_name, 0) + expense_cost\n    print(f\"Remaining budget: ${remaining_budget}\")<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Challenges and Learnings<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Learnings<\/strong>: Improved skills in dictionary manipulation, input validation, and Python\u2019s conditional logic.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Challenges<\/strong>: Managing user inputs and calculating real-time updates for both budgets and savings goals.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Future Improvements<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Implement detailed financial reports with charts and graphs.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add persistent storage for user data (e.g., using a database or files).<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Introduce a graphical user interface (GUI) for better usability.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>The Expense Tracker App provides an easy-to-use solution for managing budgets and tracking expenses, enabling users to achieve their financial goals efficiently.<\/p>\n\n\n\n<p>Below is the source code:<\/p>\n\n\n\n<pre class=\"wp-block-code alignwide has-small-font-size\"><code># Welcome message\nprint(\"Welcome to the Budget Tracker App!\")\n\n# Get user's name\nuser_name = input(\"Please enter your name: \")\n\n# Get user's total income\ntotal_income = float(input(\"Please enter your total income: \"))\n\n# Dictionary to store previous expenses\nexpenses = {}\n\n# Get savings goal\nsavings_goal = float(input(\"What is your total savings goal? \"))\n\n# Calculate remaining balance for expenses\nremaining_balance = total_income - savings_goal\n\n# Calculate remaining savings goal\nremaining_savings_goal = savings_goal\n\n# Menu\nwhile True:\n\n  # Display menu options\n  print(f\"Your remaining balance for expenses is: {remaining_balance}\")\n  print(f\"Your remaining savings is: {remaining_savings_goal}\")\n  print(\"\\nMenu:\")\n  print(\"1. Add expense\")\n  print(\"2. Add income\")\n  print(\"3. Add additional savings input\")\n  print(\"4. View all previous expense inputs\")\n\n  choice = input(\"Enter your choice: \")\n\n  # Add expense\n  if choice == \"1\":\n    expense_item = input(\"Enter the item of the expense: \")\n\n    # Validate input\n    try:\n      expense = float(input(\"Enter the amount of the expense: \"))\n    except ValueError:\n      print(\"Invalid input. Please enter a valid number.\")\n      continue\n\n    # Add expense to dictionary\n    if expense_item in expenses:\n      expenses&#91;expense_item] += expense\n    else:\n      expenses&#91;expense_item] = expense\n    remaining_balance -= expense\n\n    # Ensure remaining balance doesn't go negative\n    if remaining_balance &lt; 0:\n        # Calculate the amount exceeded the budget\n        exceeded_amount = abs(remaining_balance)\n        # Reduce the remaining savings goal\n        remaining_savings_goal -= exceeded_amount\n        # Alert the user\n        print(f\"WARNING: You have exceeded your budget by {exceeded_amount} and dipped into your savings.\")\n\n  # Add income\n  elif choice == \"2\":\n    income = float(input(\"Enter the amount of the income: \"))\n    total_income += income\n    remaining_balance += income\n\n  # Add additional savings input\n  elif choice == \"3\":\n      additional_savings = float(input(\"Enter the additional amount for savings: \"))\n      savings_goal += additional_savings\n      remaining_savings_goal += additional_savings\n\n  # View all previous expense inputs\n  elif choice == \"4\":\n    print(\"Previous expense inputs:\")\n    for item, amount in expenses.items():\n      print(f\"{item}: {amount}\")\n\n  # Invalid choice\n  else:\n    print(\"Invalid choice. Please try again.\")\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Expense Tracker App &#8220;A tool to monitor daily expenses, manage budgets, and achieve savings goals.&#8221; The Expense Tracker App is designed to help individuals manage their budgets and track expenses effectively. It provides an intuitive interface for logging expenses, updating income, and setting savings goals. This project addresses users&#8217; challenges when manually tracking expenses and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-640","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/farislabs.com\/index.php\/wp-json\/wp\/v2\/pages\/640","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/farislabs.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/farislabs.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/farislabs.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/farislabs.com\/index.php\/wp-json\/wp\/v2\/comments?post=640"}],"version-history":[{"count":5,"href":"https:\/\/farislabs.com\/index.php\/wp-json\/wp\/v2\/pages\/640\/revisions"}],"predecessor-version":[{"id":714,"href":"https:\/\/farislabs.com\/index.php\/wp-json\/wp\/v2\/pages\/640\/revisions\/714"}],"wp:attachment":[{"href":"https:\/\/farislabs.com\/index.php\/wp-json\/wp\/v2\/media?parent=640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}