23.4.7. Class BankDatabase

Class BankDatabase (Figs. 23.2623.27) models the bank’s database with which the ATM interacts to access and modify a user’s account information. The class definition (Fig. 23.26) declares function prototypes for the class’s constructor and several member functions. We discuss these momentarily. The class definition also declares the BankDatabase’s data members. We determine one data member for class BankDatabase based on its composition relationship with class Account. Recall from Fig. 23.10 that a BankDatabase is composed of zero or more objects of class Account. Line 24 of Fig. 23.26 implements data member accounts—a vector of Account objects—to implement this composition relationship. Lines 6–7 allow us to use ...

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.