Project #1 Debit Card Solution

$30.00

Description

Dynamic Arrays

Write a Debit Card tracking program. The program will read from a data file (data.txt) information about a debit card account. A sample

data file is included for this project. The program will parse the data from that file and enter it into a DebitCard object. The DebitCard object will keep track of the following information:

List of transactions

Total number of transactions account balance

Each “transaction” will be a separate Transaction object. The Transaction object will keep track of the following information: Transaction ID number

Date of transaction Description of transaction Amount of transaction

If the transaction is Pending or Cleared

As you charge purchases with your Debit card, your bank will add a “pending’ transaction to your account. Generally, after 48 hours, the

bank will “clear’ the transaction (deduct the money from your account and pay the store.) If you’ve looked at your debit card account online, you would see something like this:

OSI1312018 OeM

0811312018 oebn

0811212018 oebn

THE HOME DEPOT #4407

LINDON

THE ACTIVE JOINT INSTIoRAPER

HALECENTRETHEATRE 801-

415-

$-8.50

$-30.00

5•220.00

0811112018 oebn WINCO FOODS # 76 895 NOrem $-17.65

0811112018 oebil FAST GAS #4 OREM 5•31.50

0811112018 Debit RIFFTRAX COM SAN DIEG $-3.99

OS SERVICES STANDARD

0811012018 OeM

0811012018 OeM OSI1012018 Debn

C80049283

Sleamgames.oom42S9S22

9425-9522

VERACITY NETWORKS LLC DRAPER

5-4240

$-2499

$-5823

After all data has been read from the data file, the DebitCard object will display the following data:

total transactions total deposits account balance

list of all cleared transactions list of all pending transactions

The output MUST be formatted so that the currency amounts look right.

sample output

Much of this project has already been written for. However, this project is NOT complete. You will have to write:

DynamicArray.cpp (DynamicArray.h is provided) DebitCard.cpp (DebitCard.h is provided)

Transaction.cpp (this will be trivial. Transaction.h is provided)

You must NOT use any Standard Template libraries when implementing your Dynamic Array. That is because you are basically implementing a watered-down std::vector class. Be sure to set the initial size of your Dynamic Array to 2 and then implement a way to “grow” this array when a call to the push.backt) method has no more room for the new transaction.