Test II, CSCI 230, Spring 2018


  1. Abstract Data Type (ADT)
    1. [6 points] Give the definition for an abstract data type from the book.

  2. Arrays
    1. [2 points] What is an array? (Definition)
    2. [4 points] Name four different classes of operations that are not permitted on an array.
    3. [2 points] What is an array index out of bounds error?
    4. [4 points]What are the results of an array index out of bounds error?

  3. Typedef
    1. [2 points] What does the following statement do?
      typedef float NumberT;
      	 
    2. [2 points] How can a NumberT from above be used? Your answer should be a single English sentence and some example code segments.

  4. Enumerated Types
    1. [2 points] What are the advantages of using an enumerated type?
    2. [2 points] Give the syntax (not an example) of declaring a traditional and a strong enumerated type.
    3. [4 points] Describe the differences between strong and traditional enunmerated types.

  5. Multiple Source Code Files

    Draw a diagram which demonstrates how multiple files are combined into a single executable. Please include two user defined header files, two user defined implementation files and a main source code file.

    1. [7 points] Include the following terms:
      system header file executable local header file
      system library object fileexecutable
      source code file (implementation) compiler proper Source Code File (main)
      C pre-processor linker  

    2. [3 points] Draw a box around components of the compiler.

  6. [4 points] Searching/Sorting Big-O

    Give an example of a an algorithm with each of the following performance characteristics

    1. O(log2(n))
    2. O(n)
    3. O(n log2 (n))
    4. O(n2)

  7. [6 points] Write a complete function which takes an array of floats and an integer representing the number of elements stored in the array and returns the smallest value stored in the array.