23.4.5. Class DepositSlot

Class DepositSlot (Figs. 23.2223.23) represents the deposit slot of the ATM. Like the version of class CashDispenser presented here, this version of class DepositSlot merely simulates the functionality of a real hardware deposit slot. DepositSlot has no data members and only one member function—isEnvelopeReceived (declared in line 9 of Fig. 23.22 and defined in lines 7–10 of Fig. 23.23)—that indicates whether a deposit envelope was received.

 1   // DepositSlot.h 2   // DepositSlot class definition. Represents the ATM's deposit slot. 3   #ifndef DEPOSIT_SLOT_H  4   #define DEPOSIT_SLOT_H  5  6   class DepositSlot 7   { 8   public9      bool isEnvelopeReceived() const; // tells whether ...

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.