#ifndef LISTNODE_H #define LISTNODE_H #include // Definition of Class ListNode class ListNode { protected: // Each object contains two values int data; ListNode *link; public: // These are the member functions for the Class ListNode virtual int whoami() {return 1;} }; #endif //LISTNODE_H #ifndef DLISTNODE_H #define DLISTNODE_H #include // Definition of Class DListNode class DListNode : public ListNode { protected: // Each object contains two values int ddata; public: // These are the member functions for the Class DListNode int whoami() {return 2;} }; #endif //DLISTNODE_H #ifndef SDLISTNODE_H #define SDLISTNODE_H #include // Definition of Class SDListNode class SDListNode : public DListNode{ protected: // Each object contains two values int sddata; public: // These are the member functions for the Class SDListNode int whoami() {return 3;} }; #endif //SDLISTNODE_H #include #include using namespace std; int main() { string oper,cls,phone; int i1, i2, i3, num; while(1 == 1) { cin >> oper; cout << oper; if (oper == "quit") {// delete everything then exit(0);} else if (oper == "insert") { cin >> num; cout << " " << num; cin >> cls; cout << " " << cls; if (cls == "base") {cin >> i1; cout << " " << i1; //take appropriate actions } else if (cls == "der") {cin >> i1 >> i2; cout << " " << i1 << " " << i2; //take appropriate actions } else if (cls == "sder") {cin >> i1 >> i2 >> i3; cout << " " << i1 << " " << i2 << " " << i3; //take appropriate actions } cout << endl; } else if (oper == "member") {//... } // ... } }