class bClass{public:void setX(int a);//Postcondition: x = a;void print() const;private:int x;};class dClass: public bClass{publi
c:void setXY(int a, int b);//Postcondition: x = a; y = b;void print() const;private:int y;};Which of the following correctly sets the values of x and y?a. void dClass::setXY(int a, int b){x = bClass.setX(a);b = y;}b. void dClass::setXY(int a, int b){x = bClass::setX(a);y = bClass::setY(b);}c. void dClass::setXY(int a, int b){x = a;y = b;}d. void dClass::setXY(int a, int b){bClass::setX(a);y = b;}
The answer to the given question in the option "a".
Explanation:
In the given c++ program the correct sets value of x and y is option a:
void dClass::setXY(int a, int b) //function implementation
{ //function body.
x = bClass.setX(a); //variable x hold value of setX() function.
b = y; //variable b holds value of y.
}
And other option are not correct that can be described as:
In option b, x is private variable of the base class that is inherit by the derived class but variable y is not part of the base class. that's why it is wrong.
In option c, x= a is correct but y=b is not correct. that's why it is wrong.
In option d we access the value of the private variable x that is a part of the base class but in this we not use any variable that holds its value. that's why it is wrong.
Co-Ordination Difficulty: ... Waste of Resources: ... Larger Interests of the Enterprise Neglected: ... Emergency Decision not Possible: ... Lack of Qualified Managers: ... Certain Activities Decentralization not Possible: