1: Explain how two-dimensional arrays are passed to functions. In your explanation include a two-dimensional array declaration and initialization, a function prototype that receives a two dimensional array, and a function header with an empty body that matches the function prototype. Demonstrate how a two dimensional array is passed to the function as an argument.
2: Given a two-dimensional array named number of three rows and four colums of type int, write the single code statement that will both declare and initialize the array such that the first row is initialized to 0,1,2,3; the second row is initialized to 4,5,6,7; and the third row is initialized to 8,9,10,11.
3: Explain what constructors do and when they are executed. Explain the two types of constructors. Provide an example class that includes both types of constructor functions and demonstrate how an object would be instantiated using both types of constructors.
4: Discuss what the difference is between an interface file and an implementation file and provide file name examples for both if a class Insect is to be created using them.
SOLUTION:
5: Write and explain the definition composition and how it is useful in writing object-oriented programming. Also, explain how it is different from inheritance and how both inheritance and composition are useful in developing object-oriented programs.
6: Explain how access privileges affect members of the derived class and the objects created from them.
7: If a class is derived protected from a base class, explain how this affects the inheritance of all public, protected, and private members of the base class by the derived class.
8: Why are comments and comment blocks important to programming?