Page 327 - C++
P. 327
(i) Which type of Inheritance out of the following is illustrated
in the above example ?
Single Level Inheritance, Multilevel Inheritance, Multiple
Inheritance
(ii) Write the names of all the members, which are directly
accessible by the member function View() of class Schedule.
(iii) Write the names of all the members, which are directly
accessible by the object S of class Schedule declared in the
main() function.
(iv) What will be the order of execution of the constructors, when
the object S of class Schedule is declared inside the main()
function ?
3. (a) Write the definition of a function SumEO(int VALUES[], int N) in
C++, which should display the sum of even values and sum of odd
values of the array separately. 2
Example : If the array VALUES contains
25 20 22 21 53
Then the functions should display the output as :
Sum of even values = 42 (i.e., 20+22)
Sum of odd values = 99 (i.e., 25+21+53)
(b) Write a definition for a function UpperHalf(int Mat[4][4]) in C++,
which displays the elements in the same way as per the example
shown below. 3
For example, if the content of the array Mat is as follows :
25 24 23 22
20 19 18 17
15 14 13 12
10 9 8 7
91 8