[Skip Navigation] [CSUSB] / [CNS] / [CSE] / [R J Botting] /[CS320 Course Materials] /14q.html [14q.txt(Text)] [Search ]
Thu Apr 5 13:11:04 PDT 2012
[Schedule] [Syllabi] [Text] [Labs] [Projects] [Resources] [Grading] [Contact]
Notes: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]


    CS320/14 Questions on Data Abstraction

      Question 1 ADTs defined

      a. What is an "abstract data type"(ADT)? ( Long answer, 6 points).

      b. Describe an example of a simple ADT that illustrates your definition. ( 4 points ).

      c. How would your code your example ADT in C++? (5 points)

      Question 2 UML Notation

        2a. How do you show in UML that

      1. a. a class is an interface?

      2. b. a class is abstract?

      3. c. one class implements or realizes another abstract class?

      4. d. one class uses an interface and another class implements the interface?
      Answer: [ 15ole.gif ]

      2b. Here [ 14q.cpp ] is a file with three classes: A, B, and C. Which is a client, which is an interface, and which implements the interface?

      Question 3 Specification vs Implementation

      List the advantages of defining ADTs in two separate parts: specification and implementation.

      Question 4 Design Requirements

      List the design requirements for a language that supports abstract data types.

      Question 5 Language Support for ADTS

      Give examples of 3 different languages with different support for ADTs and describe the way each supports them.

      Question 6 Stacks

      The run time stack in a language environment is an implementation of the Stack ADT. Write a specification for the ADT Stack.

      Question 7 C++ ADTs

    1. a. Describe the C++ mechanism for defining and implementing abstract data types.

    2. b. What is wrong with the C++ approach?

      Question 8 Java vs C++ ADTs

      Explain how Java differs from C++ with respect to providing data abstraction. What has been added? What has been removed?

      Question 9 Ada Packages

      Explain how the three parts of an Ada package work: Public, Private, and Body.