Simulation of Financial Management Gaming Project in C++

Explanation

  1. Class Definition:
    • Transaction Class:
      • Represents a financial transaction with type (DEPOSIT or WITHDRAWAL) and amount.
      • Constructor: Initializes the type and amount of the transaction.
      • Getters: Retrieve the type and amount of the transaction.
    • FinancialManager Class:
      • Manages account balance and records transactions.
      • Private Members:
        • balance: Current balance of the account.
        • transactions: Vector storing all transactions.
      • Public Methods:
        • deposit(double amount): Increases the balance and records a deposit transaction.
        • withdraw(double amount): Decreases the balance if sufficient funds are available and records a withdrawal transaction. Returns false if there are insufficient funds.
        • printStatement(): Prints the current balance and a list of all transactions.
  2. main Function:
    • Prompts the user for the initial balance and creates a FinancialManager object.
    • Provides a menu to:
      • Deposit money.
      • Withdraw money.
      • Print the account statement.
      • Exit the program.
    • Handles user input and performs the corresponding actions.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top