This project is made by Team 25, a simple Digital Wallet Management System implemented in C++ that allows users to create accounts, transfer funds, view transaction history, and manage wallet balances. The system is designed to be a basic simulation of a wallet system with features such as user registration, money transfers, account merging, and transaction tracking.
- User Registration: Allows users to register with a unique ID, name, and an initial balance.
- Login: Secure login using a username and password.
- Fund Transfer: Users can send funds from their wallet to another user's wallet. The system tracks each transaction with an ID, date, sender, and receiver.
- Transaction History: Users can view their past transactions.
- Balance Management: Users can view their current balance, add funds, or deduct balances.
- Account Merging: Two users' accounts can be merged into one, combining their balances and transactions.
- Data Persistence: User data and transactions are saved to a file (
users.txt), ensuring that the data is persistent across sessions. - Account Deletion: Remove an account entirely from the system.
- Transaction.h / Transaction.cpp: Contains the
Transactionclass, which defines the structure and functionality of a transaction (ID, amount, sender, receiver, and date). - User.h / User.cpp: Contains the
Userclass, which defines a user, their balance, transactions, and associated methods (e.g., adding funds, viewing balance, transaction history). - Wallet.h / Wallet.cpp: Contains the
Walletclass, which manages the entire system of users, allowing for registration, fund transfers, user removal, and account merging. - main.cpp:
- Provides the main user interface for interacting with the system.
- users.txt:
- A text file to store user data persistently between sessions.
- Makefile: A build file used for compiling the project. It specifies compiler flags, object files, and build targets.
Ensure that you have a C++ compiler installed (e.g., g++ for Linux or macOS). The code has been tested with C++11 standard, so make sure to compile with at least this version.
-
Open a terminal and navigate to the directory containing the project files.
-
Run the following command to compile the project:
make
This will generate the executable
DigitalWalletSystem.
Once the build is complete, you can run the program by typing:
./DigitalWalletSystemThis will start the wallet management system, allowing you to register users, add funds, transfer money, and perform other actions.
- Build:
make- Compiles the source code and generates the executable. - Clean:
make clean- Removes object files and the executable.
The project uses a file named users.txt to store user data and transactions. This file is created when the program is run for the first time and is automatically updated when users are added or transactions are made.
Here’s an example of how the wallet system works:
-
Register Users:
wallet.registerUser("user1", "Alice", 100.0); wallet.registerUser("user2", "Bob", 50.0);
-
Add Funds:
wallet.addFunds("user1", 20.0);
-
Transfer Funds:
wallet.transferFunds("user1", "user2", 30.0, "2024-11-14");
-
Show Transaction History:
user1.showTransactionHistory(); user2.showTransactionHistory();
-
Merge Accounts:
wallet.mergeAccounts("user1", "user2");
Represents a transaction with the following attributes:
transactionID: Unique identifier for the transaction.date: Date of the transaction.senderID: ID of the user sending the money.receiverID: ID of the user receiving the money.amount: The amount of money transferred.
Methods:
displayTransaction(): Prints the transaction details.- Overloaded
<<operator to write transactions to a file.
Represents a user with the following attributes:
name: The user's name.userID: Unique identifier for the user.password: The user's secure password.balance: The user's current balance.transactions: A list of transactions the user has made or received.
Methods:
operator+=(): Overloaded operator to add funds to the user’s balance.deductBalance(): Deducts an amount from the user’s balance if sufficient funds exist.addTransaction(): Adds a transaction to the user's history.showBalance(): Displays the user's current balance.showTransactionHistory(): Displays the user's transaction history.operator+(): Merges the account of two users.
Manages all users and their transactions:
registerUser(): Registers a new user.getUser(): Retrieves a user by their ID.addFunds(): Adds funds to a user's wallet.transferFunds(): Transfers funds between two users.removeUser(): Removes a user from the system.mergeAccounts(): Merges two user accounts into one.
We welcome contributions to this project. If you'd like to contribute, feel free to fork the repository, make changes, and submit a pull request. You can also report bugs or suggest new features by opening an issue.
This project is open-source.
For questions, suggestions, or feedback, please reach out to:
Email: cs23b1015@iiitdm.ac.in