CSci 555-01: Functional Programming
Spring 2016


Cookie Jar Abstract Data Type (ADT) Problem Description

This problem is (more or less) the Cookie Jar ADT described in exercises #4 and #5 on page 33 of Nell Dale and Henry M. Walker's textbook Abstract Data Types: Specifications, Implementations, and Applications (D.C. Heath and Company, 1996).

Problem

The exercise is to define and implement an ADT for cookie jars, with operations for manipulating the jar and its contents. As defined in the Dale and Walker textbook, the CookieJar ADT has the following operations:
create
to create a new empty cookie jar

putIn(cookieJar,cookieType)
to add one cookie of type cookieType into the cookieJar

eat(cookieJar,cookieType)
to remove one cookie of type cookieType from the cookieJar

isIn(cookieJar,cookieType)
to determine whether or not the cookieJar contains any cookie of type cookieType

isEmpty(cookieJar)
to determine whether or not the cookieJar is empty


Copyright © 2016, H. Conrad Cunningham
Last modified: Tue Mar 8 15:53:30 CST 2016