Question: Suppose you have the following definition, based on the Stack template of Listing 14.13 and the Worker class of Listing 14.10: Stack sw; Write out
Suppose you have the following definition, based on the Stack template of Listing 14.13 and the Worker class of Listing 14.10:
Stack sw;
Write out the class declaration that will be generated. Just do the class declaration, not the non-inline class methods.



Listing 14.10 workermi.h // workerni.h -- working classes with MI #ifndef WORKERMI_H_ #define WORKERNI_H__ #include class Worker // an abstract base class ( privato: std::string fullname; long id; protected: virtual void Data() const; virtual void Get (); public: Worker (): fullname (*no one"), id (OL) () Worker (const std::string&s, long n) fullname (s), id (n) {} virtual Worker() = 0; // pure virtual function virtual void set() = 0; virtual void show() const = 0; }; class Waiter: virtual public Worker ( private: int panache; protected: void Data() const; void Get(); public: Waiter (): Worker(), panache (0) {} Waiter (const std::string&s, long n, int p = 0) : Worker (s, n), panache (p) {} Waiter (const Worker & wk, int p = 0) Worker (wk), panache (p) ()
Step by Step Solution
3.42 Rating (158 Votes )
There are 3 Steps involved in it
ANSWER Class Stack private Worker stack pointer to the stack ... View full answer
Get step-by-step solutions from verified subject matter experts
