Question: 6. Given the base and its three derived classes below (Optional extra 10 points) class base f public: base() virtual void show) e; / pure

 6. Given the base and its three derived classes below (Optional

6. Given the base and its three derived classes below (Optional extra 10 points) class base f public: base() virtual void show) e; / pure virtual function; all show(0 functions in derived class automatically virtual // no need to implement class d string : public base t prefix 'd' means derived public d string)); void set(string); void show() // implemented inline private: string str; class d int: public base ( public: d int) void set (int); void show(); // implemented inline private: int num; ciass d_char : public base ( pubiic: dchar)00; // implemented inline void set (char); void show) private: char chr ti #inc lude #include string #include using namespace std; int main) base *bobj; d string strObj; d int intobj; d_char charObj; return You are asked to a) Implement the set and show functions in the d_char derived class. b) Assuming all member functions for the three derive d classes have been properly set, fill in the missing code fragment (in the place of . in the main) function) with polymorphic function calls such that the program eenerate the following output: 6% D:WINDOWSisyste D:1WINDOwsisyste... teger value 999 sa any koy to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!