This is my second Java project that allows users to create an account and plan for their budget. The account section will enable users to create or log in to their accounts using their first name and last name. After signing an account, the user is allowed to create his or her budget plan. I started this project to apply what I have learned from the University of Helsinki's MOOC.fi Java II Programming. This project gave me a more profound understanding of object-oriented principles in Java and the use of packages and imports (such as PrintWriter and File API).
To launch the program, follow these simple steps
- Go to src folder
- Go to the
Main
class. - Make sure that the following code is present
import BudgetTracker.userinterface.*; public class Main { public static void main(String[] args) { UI ui = new UI(); ui.start(); } }
- Run the
Main
class to execute the program. - The program must start with the following
Please choose a number to continue [1] Open account [2] Plan your budget [3] Exit
Once the program is executed, users can either create or log in to an account which allows them to explore the functionalities available for the account and budget section.
- Sign-in account
- Create Account - creates a new account and store it in
List of Accounts
file - Login Account - retrieves the matched account from the
List of Accounts
file
- Create Account - creates a new account and store it in
- Deposit money - can only add the amount to an account's balance if there is an existing account
- Check balance - displays the account's balance at the current time
- Withdraw money - can only subtract the amount from an account's balance if there is an existing account
- Check savings - displays the account's savings at the current time
- Create a list of expenses
- Add - add a new spending category to list and store it to an account's budget file
- Remove - remove existing spending category to list and store it in an account's budget file
- Clear - delete all spending categories to list and store them in an account's budget file
- Display total expenses - display existing total expenses retrieved from the file or from the newly created list of expenses
- Display monthly budget data - display budget data statistics by showing the total expenses and the total savings
- Save money - save money to the account and store the updated value in
List of Accounts
file
-
Format Requirements: The file should be in Comma-Separated Values (CSV) format so that it can be read and processed. The following format is exemplified as shown below:
File name: List of Accounts Format: FirstName,LastName,Sex,InitialBalance,Savings Contents: Melina,Huffman,FEMALE,100000.0,0.0 Larissa,Hopkins,FEMALE,90000.0,7500.0 Orion,Jacobson,MALE,85000.0,2500.0 Agustin,Warren,MALE,45703.0,15000.0 Scarlet,Hayden,FEMALE,65478.0,5100.0
You can change the contents of the file as long as you follow the CSV format.
-
Location: There is a ready file named
List of Accounts
inside the BudgetTracker folder. Please do not change the file name or else the code would not be read and processed. You can create a new file as long as you revise the file name inside theAccountManager
class.package BudgetTracker.logic; import BudgetTracker.domain.Account; import java.io.*; import java.nio.file.*; import java.util.*; public class AccountManager { private List<Account> accountList; private File file; public AccountManager() { this.accountList = new ArrayList<>(); this.file = new File("Lists of Accounts"); // Change the file name. Example: this.file = new File("Account Database") } }
- Format Requirements:
Every time an account has been signed-in, it automatically creates a budget file created which can be used as a storage of expenses.
The file format is always SURNAME YEAR MONTH and its content is always empty. This budget file is processed and used to calculate the
expenses (total, by wants, by needs). You can input the expenses inside the budget file as long as you follow the CSV format as shown below:
File name: Huffman 2023 AUGUST Format: SpendingCategory,Cost,WANTS/NEEDS Contents: Utilities,9000.0,NEEDS Rent,15000.0,NEEDS Clothes,9700.0,WANTS Grocery,5500.0,NEEDS
- Location: The location of a new or existing budget file will always be inside the BudgetTracker folder and not inside the src folder.