Skip to content

A simple expense tracker application to manage your finances. The application should allow users to add, delete, and view their expenses. The application should also provide a summary of the expenses.

License

Notifications You must be signed in to change notification settings

MarvynHarry/Expense-Tracker

Repository files navigation

Expense Tracker CLI Application

Overview

The Expense Tracker is a simple command-line application written in C#. It allows users to manage their finances by adding, updating, deleting, and listing expenses. The application also provides a summary of total expenses or expenses for a specific month. Sample solution for the Task Tracker challenge from roadmap.sh.

Expenses are stored in a JSON file and can be manipulated directly from the command line.

Features

  • Add an Expense: Add an expense with a description and amount.
  • Update an Expense: Update the description and amount of an existing expense by its ID.
  • Delete an Expense: Delete an expense by its ID.
  • List Expenses: View all recorded expenses, including ID, date, description, and amount.
  • Summary of Expenses: Get the total amount of all expenses.
  • Monthly Summary: Get the total amount of expenses for a specific month of the current year.

How to Run

Prerequisites

  • .NET SDK (Ensure you have installed the .NET SDK)

Clone the repository

git clone https://github.com/your-username/expense-tracker-cli.git
cd expense-tracker-cli

Build and Run the Application

  1. Build the project:
dotnet build
  1. Run the project:
dotnet run

Example Usage

Once you run the program, you will be prompted with the following options:

Expense Tracker Commands:
1. Add Expense
2. Update Expense
3. Delete Expense
4. List Expenses
5. Show Summary
6. Show Summary for Month
0. Exit

Commands Overview

  • Add Expense: Adds a new expense.
Select a command: 1
Enter description: Lunch
Enter amount: 20
Expense added successfully (ID: 1)
  • List Expenses: Lists all added expenses with details.
Select a command: 4
ID    Date        Description         Amount
1     2024-09-24  Lunch               $20.00
  • Update Expense: Updates an existing expense using its ID.
Select a command: 2
Enter expense ID to update: 1
Enter new description: Dinner
Enter new amount: 25
Expense (ID: 1) updated successfully.
  • Delete Expense: Deletes an expense using its ID.
Select a command: 3
Enter expense ID to delete: 1
Expense deleted successfully.
  • Summary of Expenses: Displays the total expenses.
Select a command: 5
Total expenses: $25.00
  • Show Summary for a Specific Month: Displays the total expenses for a specified month of the current year.
Select a command: 6
Enter month (1-12): 9
Total expenses for month 9: $25.00

Support My Work

If you enjoy my work or want to support what I do, feel free to Buy Me a Coffee!

Contributing

Feel free to submit a pull request or report issues to help improve the project!

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any questions or support, please reach out via GitHub Issues.

About

A simple expense tracker application to manage your finances. The application should allow users to add, delete, and view their expenses. The application should also provide a summary of the expenses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages