Question: Create a class called AccountStore (shown below) to maintain an array of pointers to Account objects (from Exercise 1). Assume account store has a max
Create a class called AccountStore (shown below) to maintain an array of pointers to Account objects (from Exercise 1). Assume account store has a max capacity of 10 accounts to maintain. Provide public accessor methods to create account, get number of accounts, get account at index, and to delete the account from the account store. CreateAccount() should return the index of newly created account (also the account number) and -1 if store is full and DeleteAt() should return the status true if account is deleted or false otherwise.

Account pointer description:

Account Store - number of accounts: int - accounts[10]: Account* - currentIndex: int = 0 -max_index: const int = 9; + Create Account(int balance): int (index) + Delete At(int index): bool + GetAccount(int index): Account* + GetNumberOfAccounts(): int Account - account Number: int - balance: double = 0.0 + Account(accountNumber.int, balance:double) + getAccountNumber(): int + getBalance(): int + setBalance(balance: double): void + credit(amount: double): void + debit(amount: double): void + print(): void A/C no: Xxx Balance=$XXX
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
