23.4.12. Test Program ATMCaseStudy.cpp

ATMCaseStudy.cpp (Fig. 23.36) is a simple C++ program that allows us to start, or “turn on,” the ATM and test the implementation of our ATM system model. The program’s main function (lines 6–11) does nothing more than instantiate a new ATM object named atm (line 8) and invoke its run member function (line 9) to start the ATM.

 1   // ATMCaseStudy.cpp 2   // Driver program for the ATM case study. 3   #include "ATM.h" // ATM class definition 4  5   // main function creates and runs the ATM 6   int main() 7   { 8      ATM atm; // create an ATM object 9      atm.run(); // tell the ATM to start10   } // end main

Fig. 23.36. ATMCaseStudy.cpp starts the ATM system.

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.