23.4.3. Class Keypad
Keypad (Figs. 23.18–23.19) represents the keypad of the ATM and is responsible for receiving all user input. Recall that we are simulating this hardware, so we use the computer’s keyboard to approximate the keypad. A computer keyboard contains many keys not found on the ATM’s keypad. However, we assume that the user presses only the keys on the computer keyboard that also appear on the keypad—the keys numbered 0–9 and the Enter key. Line 9 of Fig. 23.18 contains the function prototype for class
Keypad’s one member function
getInput. This member function is declared
const because it does not change the object.
1 // Keypad.h 2 // Keypad class definition. Represents the keypad of the ...