Project 2 Programming Project
Overview Using Classes
Implementation (20 points)
Implement a simple automated bank registry system. The implementation will include several attributes related to a transaction, and the data will be managed in a global linked list within memory. The program must use the “list” API in the C++ standard template library. All of the attributes associated with each transaction will be stored as a single object within a global linked
list data structure. The program must implement at least one class that will hold the following
variables: transId — An integer for the transaction ID that consists of a number starting at 1000 for the first transaction in the linked list and automatically incremented by 1 for each subsequent transaction entered into the linked list. The user will not enter this number. date — A string for the date of the transaction. The date must be in the form mm/dd/yyyy. The program must re-prompt the user to reenter the date if it is not a valid form.
description — A string variable to indicate the description of the transaction
(spaces between words must be allowed).
payment — A double variable to indicate a transaction payment or deduction
from the account. A value of 0 if the transaction is not a payment.
deposit — A double variable to indicate a transaction deposit or addition to the account. A value of 0 if the transaction is not a deposit.
Provide the appropriate accessor methods to set and get the data for each of these class variables.
For example setDate(string date) and getDate(). In addition, the main program must provide
the following functionality:
1. When the program is first started, it must read a data file called registry.dat. The
program should not prompt the user for the name of the data file. If the file exists, the
program will load the data for each transaction into the global linked list data structure.
If the file does not exist, the program will start with an empty linked list.
2. The program should provide a simple text-based user interface similar to the Book Inventory example that manages the all of the transactions within the global linked list.
Each transaction must be placed in this global linked list as an object that holds all of the information associated with the given transaction. The user interface will allow the
user to do the following:
(a) Display Registry – displays all of the transactions in the global linked list. This
feature will display all of the fields associated with the each transaction. In addition it must also print the total number of transactions, the total amount in
payments, the total amount deposits, and the total balance, which can be calculated as follows:
(b) Enter Transaction – allows the user to enter all of the fields associated with a
given transaction, except for the transId, which will be automatically generated by the program as previously mentioned. After the data fields are entered, the program will place the transaction entry in the global linked list data structure that is kept in memory. Note: a deposit transaction will have a 0 Troy University eCampus, CS 3330 Data Structures and Algorithms. amount for payment value, and a payment transaction will have a 0 amount for a deposit value.
(c) Delete Transaction – allows the user to delete a transaction from the linked list
using the transId as the key. The program will display a message if the transaction is not found in the linked list.
(d) Search for Transaction – allows the user to find a transaction. The program will
prompt the user to enter the transId and will display a message if there are no
matching transaction in the global linked list.
(e) Edit Transaction – allows the user to edit all of the fields for a given transaction
(except for the transId) in the linked list. The program must use the transId as the key to find the entry to edit. For simplicity, the program may re-prompt the user to re-enter all of the fields associated with the given transaction; but it again must reuse the transId values. Display a message if the transaction is
not found in the linked list.
(f) Exit system – before the program exits, it must save all of the data in the global
linked list to the data file. I recommend using a standard text file with one field
per line. At this point, if the file does not exist, the program will create it.