Page 105 - C++
P. 105

int S; public:

          void INPUT();
          void OUTPUT();
          };

          class WORLD: private NATION

          {

          int T; protected: int U; public:

          void INDATA(int, int); void
          OUTDATA();

          };

          class STATE: public WORLD

          {

          int M; public:

          void DISPLAY(void);
             };
             (i)  Name the base class and derived class of the class WORLD.

             (ii)  Name the data member(s) that can accessed from function DISPLAY ().
             (iii)Name the member function(s) which can be accessed from the objects of class STATE.
             (iv) Is the member function OUTPUT() accessible by the objects of the class WORLD.

             3(a) Consider the following structure:                                                            [2]

                        struct Employee
                        {
                        int ECode;

                        char
                        Ename[20]; };
          Write a function to accept an Employee array and perform insertion sort in the increasing order of ECode.

          (b) An array MAT[10[11] is stored in the memory column wise with each element occupying 4 bytes of

          memory. Find out the base address and the address of element MAT[5][10], if the location of MAT[1][4] is
          stored at the address 2000.                                                                          [3]

          (c)    Give the necessary declaration of a linked list implementation queue containing integer type elements.
                 Also write a user defined function in C++ to delete an integer type number from the queue.
                                                                                                               [4]

          (d)    Write a function in C++ to print the sum of all the non-negative elements present on either diagonal of
                 a two dimensional array passed as the argument to the function.                               [3]

          (e)    Evaluate the following postfix expression using a stack and show the contents of the stack after each
                 operation.                                                                                    [2]
   100   101   102   103   104   105   106   107   108   109   110