Question: 1- What is a helper function? Explain the pros and cons. 2- There are three access modifiers in class to limit or grant access to

1- What is a helper function? Explain the pros and cons. 2- There are three access modifiers in class to limit or grant access to attributes and methods, name them and explain what they do. 3- Having the following Dynamic array of doubles class, write the code for the Constructor and copy constructor and destructor. class DoubleArray { double* m_array; int m_size; public: DoubleArray(int size) { } DoubleArray(const DoubleArray& D) { } ~DoubleArray() { } }; 4- Explain what a reference is and support it with an example. 5- Convert the following function to a template so it can be used for any type of object. Make sure your conversion is done in a way that least amount of requirement is needed for an object to work with this template. This function check to make sure the value is in acceptable range between maxValue and MinValue inclusive: bool isInRange(int maxValue, int minValue, int value) { bool ret = false; if (maxValue >= value && minValue <= value) { ret = true; } return ret; } 6- Modify the following cout statments to support the format specified: char name[41] = "Fred"; double rate = 12.34; cout << "*" << name << "*" << endl;; cout << "*" << rate << "*" << endl; * Fred*, right justified, 40 spaces *000012.340*, right justified, 3 digits after decimal, 10 spaces padded with 0 7- If Class Base has a virtual function called act(), and the Class Derived which inherits the Base class has a function called act(). 1- Is act() of Derived virtual too? 2- If Derived has another function and calls act() which act will be called, Bases or Deriveds? How can you call act() in this function to make sure the Bases act() is called. 8- How can you make sure that the destructor of Derived is always called when a dynamic Derived is pointed by bases pointer?

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!