Expense Tracker Paper
Expense Tracker Paper
In partial fulfillment
of the Requirements for the Degree in
Bachelor of Science in Computer Engineering
By
Jennel Arquillano
Shella Mea Gonzales
Charles Lauron
Mary Ann Montero
Fiona Minami Pancho
Jhonus Eizhah Usbah
January 2024
I. ABSTRACT
The Expense Tracker Program was developed to assist users in effectively managing their
budgets through a user-friendly interface designed in the C programming language. This menu-
driven program allowed users to add, edit, delete, and view expense entries while providing real-
time calculations of total expenses and monitoring budget limits. By utilizing data structures such
as struct, the program organized essential expense details including item name, price, quantity,
date, payment method, and subtotal. Additionally, the program incorporated effective error
handling to manage invalid inputs, while modularized functions were designed to enhance both
usability and maintainability. The program not only served as a valuable personal finance
management tool but also exemplified core principles of Data Structures and Algorithms in solving
real-world problems. Future enhancements could include data storage solutions and advanced
II. OBJECTIVES
The objectives for the Expense Tracker Program focus on several key areas of study.
• Examine how individuals record, monitor, and modify their daily financial transactions
• Assess the effectiveness of features such as expense entry, editing, deletion, and real-time
• Study the impact of error handling, input validation, and user-friendly prompts on reducing
Scope
The "Expense Tracker" is a console-based application developed to help users track their
daily, weekly, or monthly expenses. It allows users to efficiently manage their expenditures and
track the remaining allowance or budget. Key features include adding, deleting, and editing
expense entries, displaying expenses, and updating the budget allowance. This project aims to
provide a simple and effective solution for individuals who want to monitor their spending and
-Adding Expenses: Users can add new expenses, including details like item name, price,
-Editing Expenses: Users can edit previously entered expenses, modifying details like
-Displaying Expenses: The application will display all recorded expenses, showing item
-Budget and Remaining Allowance: Users input a weekly allowance, and the application
will show the total expenses and remaining allowance or alert the user if the budget is exceeded.
-Clear Screen: Users can clear the terminal screen for a cleaner view of the data.
-Allowance Update: Users can change the weekly allowance at any time to adjust the
budget.
Limitations
command-line interface to run. It is platform-dependent and may not be suitable for those
-Data Persistence: The program does not support saving data to files (e.g., databases or
text files). All data will be lost once the program is exited unless modified to incorporate file
handling.
-Limited Data Input Validation: Although the program has input validation for numerical
values (prices and quantities), it does not enforce strict validation for all types of user input (e.g.,
-Fixed Size Array: The expense list is implemented using a statically allocated array with
a maximum of 100 entries. If the user needs to manage more than 100 entries, the program will
-No Security or Authentication: The program does not have any password or user
authentication mechanism, meaning anyone with access to the program can modify or view the
expenses.
-Single User Use: This version of the tracker is designed for use by a single user. It does
1. Requirement Analysis:
The primary goal is to track weekly expenses and compare them against a user-defined
allowance. The application allows the user to add, edit, delete, and view expense records, while
2. Design:
Expense Structure: A struct is used to represent individual expense records. This structure holds
• method: A string to store the payment method used (e.g., credit card, cash).
• subtotal: A floating-point number calculated as the product of price and quantity for each
entry.
This structure is used to create an array of expenses, allowing for dynamic management of entries,
Input Validation: Since the program deals with user input for price, quantity, and other
values, input validation is implemented using scanf to ensure that the user enters valid numerical
Error Handling: Input is repeatedly asked for until valid data is entered. For example, the user is
prompted again if a non-numeric input is entered for a price or quantity. This is achieved through
(Expenses items[limit]), where limit is set to 100, ensuring that the system does not exceed
memory limits.
The algorithm to add a new expense involves taking multiple inputs (name, price, quantity,
date, payment method), performing validation checks for numerical inputs (price and quantity),
and then storing the new expense in the next available index in the items array.
Delete Expense (deleteExpense):
Deletion of an expense involves displaying the current expenses, asking the user to select
an entry, and then shifting all subsequent entries in the list to fill the gap left by the deleted expense.
-Shift each subsequent entry one position to the left, effectively removing the selected
Editing an expense involves first selecting an expense by its index, then offering the user
the option to modify different fields (name, price, quantity, date, method). The selected field is
This function displays all expenses along with their details, such as the price, quantity, and
subtotal. It iterates through the entire list of expenses to print each entry in a formatted table.
This function simulates clearing the screen by printing multiple newlines. It doesn't involve
any complex algorithms or data structures but provides a simple user interface enhancement.
4. Memory Usage:
Static Array: The array of Expenses items[limit] is statically defined with a limit of 100. This
limits the number of expenses the program can track. If more entries are needed, the user will be
Memory Complexity: The array uses O(n) memory where n is the number of expenses (up to 100
in the current implementation). Each expense is an instance of the Expenses struct, which holds
several pieces of data (strings and floats), contributing to the overall memory usage.
5. Time Complexity:
The program primarily operates with linear time complexity O(n) for functions that iterate
Add, Delete, Edit: These operations are O(1) for their primary actions (storing data, deleting data,
updating a single entry), but recalculating the total expense is O(n) since the program has to iterate
• Menu-Driven Interface: A simple text-based menu system allows users to choose from
options such as adding, editing, deleting, displaying, and clearing expenses. This is
implemented using a while loop that continuously prompts the user for their choice until
loops to check if inputs are valid and ensuring that the data is of the correct type (e.g., float
7. Testing:
The core functionalities (adding, deleting, editing, displaying expenses) are thoroughly
tested to ensure that the expense tracker handles all scenarios correctly. Testing includes verifying:
• Appropriate error messages for boundary conditions (e.g., trying to delete an item from an
8. Future Enhancements:
• Persistence: One major enhancement for future versions would be saving the data to a file
(e.g., a text or binary file) to allow for persistent storage of expenses across program runs.
• Optimization: To optimize the program further, dynamic memory allocation (using pointers
and malloc) could be considered to allow for a variable-sized list of expenses that grows
as needed.
• Graphical User Interface (GUI): Transitioning from a text-based console interface to a GUI
application of data structures and algorithms to address real-world challenges in personal finance
management. With a menu-driven interface and a robust design centered around C programming,
the program enables users to efficiently add, edit, delete, and view expense records while
monitoring budget limits in real-time. Utilizing modularized functions and structured data
handling, the application balances usability with maintainability, emphasizing core programming
principles. Despite its limitations, such as lack of data persistence and platform dependency, the
program provides a functional and intuitive platform for users to track and manage their expenses
effectively. The design methodology highlights thoughtful consideration of user needs, error
Future enhancements, including persistent data storage, dynamic memory allocation, and the
integration of a graphical user interface, present opportunities to expand the program’s capabilities
and improve user experience. Overall, the Expense Tracker Program not only achieves its
objectives but also serves as a foundation for continued innovation in personal finance tools.