
Patrick B. answered 10/23/20
Math and computer tutor/teacher
I have uploaded the source code and data files for you in the RESOURCES section.
Title is C++ bank records and is found under THIS LINK, and it is a TEXT FILE!!!
It is too large to put here.
The text file contains:
(1) account.h,.cpp <-- account classes
(2) customer.h,.cpp <-- customer class
(3) custacct.h <-- cross table
(4) bank.h,.cpp <-- bank class
(5) main.cpp
(6) accounts.dat, customers.dat
ISSUES:
Arrays of account objects in the customer object..
=====================================================
VERY BAD IDEA:
Without quite extensive copy constructors , this is very dangerous!
When the routine or method terminates, Customer
objects go out of scope and those addresses become invalid
The relationship is about POSSESSION and OWNERSHIP... Customer HAS account;
That type of relationship does not warrant the owned object to actually
be a member of the parent.. moreover, the account record has the customer id#
which is a foreign key. WHY DUPLICATE this data by storing them in the Customer?
The customer id field in the account record is sufficient to locate the owner.
Interest calculations
=====================
4% used if balance is between 5000 and 5001
NEVER sort by first name
===========================
Customer and Account header files contain declarations
for callback function pointers, which are used for searching
and sorting. They can be passed to qsort and binsearch in stdlib.h;
You can now sort the records yourself.
Good luck!