Question: Exercise #20 Given the following Program: void printMax(double var1, double var2, double var3) const { int result; // if (var1 > var2 && var2 >

Exercise #20 Given the following Program: void printMax(double var1, double var2, double var3) const { int result; // if (var1 > var2 && var2 > var3) cout << var1 << endl; else cout << "not var1.." << endl; } What is the usage of the const keyword in this member function of a certain class ? a. Assure all local variables of this function will remain const and cant be changed. Any attempt will result in compilation error . b. Make sure the method returns a const value that cant be changed. c. Assure data members of the class are constant within the method and cant be changed. Any attempt will result in compilation error . d. Make sure the method is static const . Exercise #21 Where a const data member can be initialized? a. In a member function. b. Only when using inheritance. c. In the Initialize List. d. Only in a const method. Exercise #22 Usage of typical/standard polymorphism can be defined as: a. Usage of Destructors. b. Usage of Virtual Functions. c. Usage of Inheritance. d. Both (a) and (c).

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!