CSCI 131,

Fall 2002,

Test 2.


  1. [5 pts] Define Abstract Data Type.
  2. [5 pts] Use the type char to explain the definition of an ADT.
  3. [10 pts] Draw a picture of the compile and linking process. Explain what is happening at each stage. Use the following terms.
    compiler       executable     header file
    library        linker         object code
    preprocessor   source code
    
  4. [3 pts] Show how to, and explain all parts of declaring an array.
  5. [5 pts] Discuss how array parameters are passed. Explain
  6. [5 pts] Discuss out of bounds array indexing errors.
  7. [10 pts] Write a routine which, given an array of characters (ary) with length len (len < MAXLEN), will reverse the letters in the array.
    rev(a, len);
    
        if a  is 
    abc
    it will be
    cba
  8. [7 pts] You are writing a program that uses a coin to determine the outcome of various events. (Flip a coin). Define the domain of a coin, define the operations on a coin. Declare a class based upon your definitions. You do not need to implement your class.