1. Information hiding means that an object bundles data items and their methods into a single entity.
    (a) TRUE (b) FALSE

  2. What Property describes the bundling of data items and their methods into a single entity ____.
  3. In object-oriented programming, the combination of data and operations that handle the data is referred to as
    (a) encapsulation (b) polymorphism (c) inheritance (d) data abstraction.

  4. Which term describes the fact that two or more objects in a class inheritance hierachy have methods of the same name that perform distinct tasks?___
    (a) operator inheritance (b) method duplication (c) polymorphism (d) task hierachy.

  5. With C++ inheritance, the class that inherits data and methods from its parents and then extends the class is called the ____ class.
    (a) base (b) extended (c) derived (d) root.

  6. An item that represents an instance of a class is called a(n)____.
    (a) instvar (b) constant (c) Class type (d) Object.

  7. In a class, the data and operations are referred to as ____.
    (a) members (b) control structures (c) methods (d) resident parts.

  8. In a class, the public members ____.
    (a)Describe data and operations that can be used only by methods in the class.
    (b)Describe data and operations that are available to a client when using a class object
    (c)are global functions and data.
    (d)are accesible to any code block with appropriate access rights.

  9. The language C++ was developed at Bell Labs by ___
    (a) Bjarne Stroustrup (b) Maurice See (c) David Watson (d) Brian Kernighan.

  10. Modern Data Structures can be done only in the language C++ ___.
    (a) True (b) False.

  11. The following is a partial decleration of the SeqList class. Use it with parts A to C.
    class SeqList
    {
    private:
      .....
      public:
       // constructor
      SeqList(void);
    
      //List access methods
      int ListSize(void) const;
      DataType GetData(int pos) const;
    
      //List modification methods.
      void Insert(const DataType& item);
      void Delete(const DataType& item);
      DataType DeleteFront(void);
    };
    
    
    1. The main program calls the function PrintList that outputs the elements in the list. Trace the code and give the outputs #1 to #5
      #include <iostream.h>
      
      typedef int DataType;
      #include "aseqlist.h"
      
      void PrintList const SeqList &L
      {
        for (int i=0;i<L.ListSize();i++)
          cout <<L.GetData(i)<<" ";
        cout << endl;
      }
      
      void main(void)
      {
        SeqList L;
      
        L.Insert(5);
        L.Insert(10);
        L.Insert(1);
        L.Insert(15);
        PrintList(L);            //Output #1 ____
        if (L.GetData(1)==10)
          L.DeleteFront();
        PrintList(L);           //Output #2 ____
        L.Insert(25);
        L.Delete(1);
        cout << L.ListSize()<< endl; // Output #3 ____.
      
        PrintList(L);          //Output #4 ____
        while (!L.ListEmpty())
          {
            cout << L.GetData(0)<<endl;
            L.Delete(L.GetData(0));
          }
      }                        // Output #5 ____
      
      
    2. In the main program determine Output #5 if the while loop were changed to
      while(!L.ListEmpty())
      {
      	cout <<L.GetData(L.ListSize()-1)<< endl;
      	L.DeleteFront();
      }
      //OutPut #5
      
    3. In object-oriented design, first develop the subprograms that will be used by the main program and place them as methods in a series of class declarations.
      (a) True (b) False.