1  # include "telephone.h"
  2  # include "connection.h"
  3  
  4  void Telephone::run(Connection& c)
  5  {
  6     bool more = true;
  7     while (more)
  8     {
  9        string input;
 10        getline(cin, input);
 11        if (input == "H")
 12           c.hangup();
 13        else if (input == "Q")
 14           more = false;
 15        else if ((input.length() == 1) &&
 16           (isdigit(input[0]) || input[0] == '#'))
 17           c.dial(input);
 18        else
 19           c.record(input);
 20     }
 21  }