[go: up one dir, main page]

0% found this document useful (0 votes)
9 views7 pages

Personalized Finance App Programming Guide

The Personalized Finance App Programming Guide provides a 12-step process for beginners to create a budgeting application using programming concepts. It emphasizes the importance of self-learning and practical application while guiding users through setting up their coding environment, processing transaction data, and generating reports. The guide also includes prerequisites, tips for effective coding, and a sample CSV file for practice.

Uploaded by

mabeni4929
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views7 pages

Personalized Finance App Programming Guide

The Personalized Finance App Programming Guide provides a 12-step process for beginners to create a budgeting application using programming concepts. It emphasizes the importance of self-learning and practical application while guiding users through setting up their coding environment, processing transaction data, and generating reports. The guide also includes prerequisites, tips for effective coding, and a sample CSV file for practice.

Uploaded by

mabeni4929
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

The Personalized Finance App Programming Guide

HenrikM Dev

Hello! Thank you for downloading this programming guide!

In this modern digital era, programming and programmers have become more and more crucial
to building anything in this world.

Maybe you want to start programming but don’t know where to begin. Maybe you are
overloaded with how information there is about programming. Or maybe you’re wondering what
your next step or next application will be.

The best way to learn programming is to just start building something. I hope you will find this
project to be fun and insightful!

This 12 step guide will lead you (especially if you have no programming experience) through the
thought process I went through when I coded my version of this program in C.

C is my preferred language, but you can code this in any language or coding platform you like.

After all, like any verbal language, programming languages are only meant to communicate
what is in our minds :)

The goal here is to build your first app. Once you know some fundamental programming
concepts, the possibilities for what you can build will start to open up. And as you practice your
programming language more, you will become fluent!

Sounds good? Let's begin!


Prerequisites
Just a quick note before we begin. You may need to look up some coding tutorials for your
language on your own as you go through each step. That's part of the process! This guide
requires you to know/learn:
● How to output to a console or display information (look up "Hello, world!" examples)
● Data types: particularly string, integer and float types, and data structures
● Operators
● While-loops, for-loops, and if-else statements and ladders
● Functions
● How to open a file programmatically

If you don't know anything at all, don't be discouraged or overwhelmed. These concepts may
take weeks to learn. That's normal! But at least you have a system in place now and a path
moving forward :)

Check out my YouTube channel for tutorials that will help with building this app!

If you get confused about one of the steps, feel free to email me at henrik@henrikmdev.com

Step 1: Setup your coding environment


● Figure out where you are going to start coding
○ You can code locally on your computer or remotely in a cloud IDE server
○ Generally speaking, you need a way to write, compile, then execute/run your
code
● Download a CSV file of your recent transactions from your credit card account
○ A CSV file is similar to an excel spreadsheet file. It displays data as
comma-separated values (CSV)
○ This will be the input data for your application
○ If you don't have a credit card account that can export your transactions to a
CSV, I have a sample one at the end of this guide
● Create your main program file where you will write your code
○ E.g. “budget.c” or “budget.py”

Step 2: Displaying/printing information


● Have your program display/print “My Budget” or whatever message you like
● Knowing how to display/print data is crucial to getting feedback from your program
● Not only will it help you display the results of your program at the end, but it will also be
helpful for debugging your code when there are issues
Step 3: Opening the CSV file
● This step is not about having the file opened in excel or any other application
● Your program IS the application and you need it to open the CSV file programmatically
so that it can start to process the transaction data
● Usually, this involves a line of code that calls a function to open the file with the file name
as one of the arguments of that function (often called “fopen”)

Step 4: Create a data structure that corresponds to the data in your CSV
file
● This data structure will be the primary place where your data is stored.
● An example would be to have a data structure that has the following fields:
○ The transaction date
○ The item/description
○ The cost
○ The budget category

Step 5: Read in all the data from the file into your program
● Read in the first line of your file and print it to the console
● Use a while-loop to print every line of your file to the console
○ Congrats, you can read in all of your data!
● Create a variable to keep track of how many lines of actual transaction data are in your
file.
○ This can be done by initializing a variable to 0 and then incrementing it by 1 in the
while-loop for every iteration that reads in a line of actual transaction data. You
will use this variable in step 9
○ Print the variable after the while-loop and see if that number actually matches the
number of transactions you have in the file

Step 6: Closing the file


● You should close the file in your program to release memory that was allocated for it
● Use the inverse function to the one you used in step 3 to close the file (usually called
“fclose”)

Step 7: Focus on parsing the first line


● This is probably the header for each column in your CSV.
● Get the first token/header of the line and print it to the console to make sure you are
getting it correctly. Repeat for all tokens/headers in your first line.
● After proving you can print each header, print just the headers you care about
○ Probably the transaction date, the item/description, and the cost
Step 8: Focus on parsing the first line of actual transaction data
● Using the same parsing techniques from step 7, parse the next line (the second line) of
your file which should be the first line of actual transaction data
● Remember that you were able to print the second line of your file with the while-loop
from step 5. You can use the second iteration of the while-loop from step 5 to access the
data of the next line.
● After parsing, print the parsed data to make sure you are parsing the second line
correctly.

Step 9: Store all of the actual data in your data structure array
● Create an array of the data structure type you created in step 4. The array size should
be the same as (or greater than) the number of transactions in your file.
● Store the fields from your first transaction in the first index of your array (usually index 0).
Repeat this for the rest of the transactions.
● You can use the variable you created in step 5. As it increments, you can use it as an
index to point to the next index of your array to store data.
● As in step 5, instead of printing the whole line per iteration, just print out the fields of
each index of your data structure array (aka each transaction) to make sure all the data
was stored correctly into your data structure array

Step 10: Categorize each transaction


● As you store each line in your data structure array, fill in the budget category too.
● You will need to design an algorithm for this that will fill in the right category for each
transaction.
● This algorithm should just check the item/description of each transaction. For example, if
it has the word “Cafe” in it, then use the category “Dining out”.
● Test your algorithm by printing a certain category when a certain category is detected by
your algorithm.
● When you see that the algorithm is printing the right categories correctly for each
transaction, store the detected category in the data structure itself.
● Instead of printing each detected category as each line is classified, print the fields of
each index of the data structure like in step 9 including the category field. This proves
that all of our data is stored and classified correctly in our data structure.
● Bonus challenge: For a good budget app, the algorithm should grow to check a large
amount of strings to determine the category. For example, for the “Dining out” category,
you will start to have a lot of restaurant names to check with. So then, it would be good
to create an array of strings per category and programmatically compare the
item/description with the strings in this array. You could create a function that takes the
item/description and the array of strings and call this function for every category in your
budget.
Step 11: Process the data
● Now that you have a while-loop that reads in all of your data and categorizes each
transaction, create a for-loop after your while-loop to do all the calculations you like with
your data structure array. This for-loop will use the variable you created in step 5 for the
exit condition.
● One helpful calculation would be to sum up all of the expenses in each category. You
can then get a category sum that will tell you how much you spent this in that category.
● As you iterate through each stored transaction in your data structure, you can add the
cost field of each transaction to it's respective category sum. To do this, use an if-else
ladder where each condition corresponds to a particular category and increases that
category’s sum with the cost field of your data structure.
● Bonus challenge: Instead of iterating through all of your data twice, you can combine
both loops in one. In the while-loop that reads all of your data, you can actually do the
processing there as well. Having two loops is cleaner and easier to follow, but having just
one loop is more efficient.

Step 12: Create your report


● The hardest part is now over! You can now print your final report!
● Print the results from step 11 however way you want. For example, you can print a
category and the amount you spent in that category.
● Be creative, make the report look as neat and pretty as you can!
● Bonus challenge: Since this is a budget app, create a constant for each category that
corresponds to the set budget you have for that category. You can use this number to tell
you if you went over budget or have budget left to use for your category.

Extra Tips:
● Use variable names that are descriptive. You don’t want to use variables with the name
“a” and “b”, because you will eventually forget what each variable is for, especially if you
take an extended break from your program.
● Use a lot of comments in your program to help you remember what each part of your
code does. This will help you think through your program, but ultimately helps others and
your future self know what the code is doing.
● When something isn't working properly, use print statements to verify the value of certain
variables.
● When you can't figure out why there is an error:
○ Use print statements to find the exact line that is causing the error
○ Comment out parts of the code to narrow down which part is causing the error
● Your code doesn’t have to be perfect. Get it to work first, then optimize/clean it up later
Becoming a Programmer
Here’s why I think this would be a good project for new programmers.

You learn some core fundamental programming concepts, set up a development environment
you can use to build another app idea, and build something that you can actually use in real life.

You also learn an essential programming skill: self learning. Every programmer practices this
skill at some point since there are endless useful programming tools, libraries and languages
out there.

Building this app gives you the typical programming experience but with the path forward laid
out.

As you learn more paths of programming and how programs work, you gain more insight into
what's possible. With this comes more ideas for more apps!

As you build more, it turns into this snowball effect and you become a better and better
programmer.

I hope this encourages you and helps you make good initial progress. Again, check out my
YouTube channel for tutorials that will help with building this app!

Thank you for downloading this guide. May this be a good start to your programming journey!

Henrik Molintas
henrikmdev.com
Sample CSV
In case you don’t have a CSV file from your credit card account, here is a sample one you can
play with. Just copy and paste it into a new file and name it with the .csv extension:
"Transaction Date","Posted Date","Description","Debit","Credit"
"10/30/2022","10/31/2022","GIANT","4.49",""
"10/29/2022","10/31/2022","TEA PLACE","10.07",""
"10/29/2022","10/31/2022","YOGIBERRY","10.46",""
"10/29/2022","10/31/2022","DUNKIN DONUTS","19.08",""
"10/31/2022","10/31/2022","AIRBNB","56.97",""
"10/29/2022","10/31/2022","EXXONMOBIL","49.37",""
"10/30/2022","10/31/2022","AMZN Mktp","7.65",""
"10/30/2022","10/31/2022","Amazoncom","12.80",""
"10/30/2022","10/31/2022","Amazoncom","7.87",""
"10/27/2022","10/31/2022","PPINSTACART","56.20",""
"10/25/2022","10/26/2022","USPS PO","9.90",""
"10/25/2022","10/26/2022","THE UPS STORE","10.00",""
"10/25/2022","10/26/2022","DONATIONS","100.00",""
"10/23/2022","10/24/2022","GIANT FOOD INC","9.19",""
"10/23/2022","10/24/2022","STARBUCKS","10.92",""
"10/23/2022","10/24/2022","Amazon Prime","15.89",""
"10/21/2022","10/24/2022","SAFEWAY","6.80",""
"10/23/2022","10/24/2022","MicrosoftSubscription","1.99",""
"10/21/2022","10/24/2022","WALGREENS","18.01",""
"10/22/2022","10/24/2022","DOORDASH","54.55",""
"10/20/2022","10/20/2022","APPLECOMBILL","7.41",""
"10/17/2022","10/19/2022","EXXONMOBIL","53.32",""
"10/17/2022","10/19/2022","SAFEWAY","89.07",""
"10/14/2022","10/17/2022","COLPARK LOC","1.00",""
"10/16/2022","10/17/2022","AMZN Mktp","30.87",""
"10/14/2022","10/17/2022","SQ BAKEHOUSE","6.09",""
"10/14/2022","10/17/2022","POPEYES","33.39",""
"10/12/2022","10/13/2022","WEGMANS","28.35",""
"10/12/2022","10/13/2022","AMZN Mktp","30.00",""
"10/11/2022","10/12/2022","WALGREENS","50.00",""
"10/7/2022","10/10/2022","EXXONMOBIL","52.42",""
"10/5/2022","10/10/2022","PAYPAL","293.05",""
"10/9/2022","10/10/2022","AMZN Mktp","19.64",""
"10/6/2022","10/6/2022","Audible","15.85",""
"10/2/2022","10/3/2022","CAVA","23.95",""
"10/1/2022","10/3/2022","DESSERTS AND DRINK","42.40",""
"10/1/2022","10/3/2022","BBQ CHICKEN","34.45",""
"9/30/2022","10/3/2022","BAKERY CAFE","6.15",""

You might also like