Main Page

Previous Page
Next Page

[Page 1316 (continued)]

G.13. Test Program ATMCaseStudy.cpp

ATMCaseStudy.cpp (Fig. G.23) 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 611) 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.

Figure G.23. ATMCaseStudy.cpp starts the ATM system.

 1  // ATMCaseStudy.cpp
 2  // Driver program for the ATM case study.
 3  #include "ATM.h" // ATM class definition
 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 start
10     return 0;
11  } // end main

Previous Page
Next Page