Question: Given the following two class definitions such that Y is publicly derived from X. class X { public: X(int d) {data = d;} void display()

Given the following two class definitions such that Y is publicly derived from X. class X { public: X(int d) {data = d;} void display() {cout << data << endl;} private: int data; }; { public: Y(int d, int a) {additionalData = a;} void display() {; cout << additionalData << endl;} private: int additionalData; };

Using precise C++ syntax, specify the most appropriate code that should replace the three underlined items:

class Y's heading

call X's 1-parameter constructor

call X's display member function

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!