This project implements a simple digital wallet system using Java. The digital wallet allows users to perform various financial transactions such as cashing in money, sending money to other users, and paying bills. Additionally, users can view their transaction history.The wallet maintains a balance for the user and records each transaction with details such as amount, description, and date.
- Cash In: Add money to the wallet balance.
- Send Money: Transfer money to another user.
- Pay Bills: Pay various types of bills directly from the wallet.
- View Transaction History: Display a detailed list of all transactions performed by the user.
- Generate OTP: Create a One-Time Password and save it to a text file for secure transactions.
- This class defines the core properties and methods for the digital wallet:
- balance: The current balance in the wallet.
- transactionHistory: A list to keep track of all transactions.
- userName, userNumber, birthDate, refNumber: User details.
- cashIn(double amount): Abstract method to add money to the wallet.
- sendMoney(double amount, String recipient): Abstract method to send money to another user.
- payBill(double amount, String billType): Abstract method to pay a bill.
- viewTransactionHistory(): Abstract method to view the transaction history.
- Represents a transaction with properties for amount, description, and date.
- Overrides toString() method to provide a string representation of the transaction.
- This class extends the DigitalWallet class and provides concrete implementations for the abstract methods:
- Initializes the wallet with a default balance and user details.
- Formats the balance display using DecimalFormat.
- cashIn(double amount): Adds the specified amount to the wallet balance and updates the transaction history.
- sendMoney(double amount, String recipient): Transfers the specified amount to the recipient if the balance is sufficient, otherwise displays an error message.
- payBill(double amount, String billType): Pays the specified bill amount if the balance is sufficient, otherwise displays an error message.
- viewTransactionHistory(): Displays the transaction history in a message dialog.
- phonenumber: 09086233792
- mpin: 1234
- Java Development Kit (JDK) 8 or higher
- Swing library for GUI components (included in JDK)
arzadonchristianandrei@gmail.com Object-Oriented Programming Final Project 2023