Skip to main contentCal State San Bernardino / [CNS] / [Comp Sci Dept] / [R J Botting] /[CS320 Course Materials] [Text Version] lab/14.html Wed Jun 20 11:00:46 PDT 2007
Labs: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]

Contents


    CS320 Laboratory Number 14 ADTS

      Check out New things on the Course Web Page

      [ http://www.csci.csusb.edu/dick/cs320/ ]

      Goal

      To get a better grip on ways of expressing abstract data types -- -- --(ADT)
      in different languages by filling in blanks in a table.

      Also: how to do tables in HTML.

      Given


      1. A specification of a simple ADT: [ count.h ] (interface specified as a C++ header file);
        The following specification and/or interface for the Abstract Data Type called stack: [ ../stacks/stack.html ]
      2. The directory [ stacks ] is full of source code files in different languages (Ada, C, C++, Java, LISP, Prolog, SmallTalk) defining various kinds of stacks.
      3. This page with an table of links and blanks.

      Process

    1. Complete the [ count.cpp ] file that defines and tests the functions in [ count.h ]
    2. You need to study these files and figure out
      1. What language is being used?
      2. Does the code define a stack object or a class/adt of stacks? Is it an instance or a way to create instances?
      3. Is the code generic or specific to one type of item? If specific what type of item?
      4. Does the code implement the stack as specified in [ stack.html ] and if not how it breaks the spec/interface?

      Deliverables

      A new page

      The new page should have links to the specification of a counter [ count.h ] and a C++ implementation+test

       		count.cpp

      It should also have a table of links to files and with as many blanks filled in as possible.

      You can add your own opinions on any of these stacks after the table.

      You should remove irrelevant things from this page.

      Your CS320 page should be linked to this new page.

      Results

      FilesLanguageType or ObjectGeneric?Correct?
      See [ stack.ads ] [ stack.adb ] _ _ _ _
      See [ stack.cpp ] _ _ _ _
      See [ stack.h ] [ stack.c ] _ _ _ _
      See [ Stack.html ] [ Stack.html ] _ _ _ _
      See [ stack.plg ] Prolog _ _ _
      See [ stack.st ] Smalltalk _ _ _
      See [ stack2.lsp ] _ _ _ _
      See [ stack1.lsp ] _ _ _ _
      See [ stack.C ] [ test_stack.C ] _ _ _ _
      See [ stack2.C ] [ test_stack2.C ] _ _ _ _
      See [ stack2.cc ] _ _ _ _
      HeadingMeaning
      FilesLink to the source code
      LanguageUse the book and the web to figure this out
      Type or ObjectDoes the code define one stack or allow the creation of stacks
      Generic?Does the code work with only one type of data item or many
      Correct?Can you test it? Does it look OK?

      Comments

      You can add comments to this web page.

    . . . . . . . . . ( end of section CS320 Laboratory Number 15 ADTS) <<Contents | End>>

    Check the Preparation for next class

    [ ../15.html ]

End