Computer Science 3675
Section 001
Fall 2009
Practice questions for quiz 6

  1. What is the most general polymorphic type of function f defined by f(x) = tail(right(x))? Use type variables. Function right takes the right-hand member of an ordered pair. (Try an example. What kind of thing makes sense?)

    Answer

  2. What is the most general polymorphic type of the Cinnameg function filter? Use type variables. Filter is defined so that (filter p L) returns a list of all members x of list L such that p(x) is true. For example, if predicate positive returns true on a positive number and false on a nonpositive number, then (filter positive [9,-2,-3,6]) = [9,6]. Notice that p is a predicate.

    Answer

  3. Is a class an important idea of object-based programming?

    Answer

  4. Must an object-oriented language be statically typed?

    Answer

  5. A base class of a class A is a class that A immediately extends. In a single-inheritance object-oriented language, is there a limit on the number of base classes that a class can have?

    Answer

  6. In a single-inheritance object-oriented language, is there a limit on the number of subclasses that a class can have?

    Answer

  7. In object-oriented programming, you imagine that objects carry methods with them. Yet, the methods are not really stored with the objects. How does an object locate its methods? How does it know which methods to select? What is the name of the system support that is responsible for locating methods?

    Answer

  8. What are the characteristics of a virtual method? What makes it virtual?

    Answer