CSc 233 Ada Study Guide
MC logo

CSc 233 Ada Study Guide

CSc 233 Ada Home Page

This is a list of topics for review.
  1. Basic Syntax.
    1. Rules for forming identifiers.

    2. How to make control statements (loop, while, for).

  2. Data Types.
    1. Creating user types.

    2. New types versus subtypes.

    3. Name equivalence.

    4. Enumerated types.
      1. Creating types and variables.
      2. Creating subranges.
      3. Attributes: Succ, Pos, Val, etc.
      4. Overloading enumerate identifiers.
      5. Character and boolean.

    5. Arrays types.
      1. Creating variables and types.
      2. The attributes first, last, and length.
      3. Slices.
      4. Rules for assigning arrays and slices.
      5. Arrays of arrays versus multi-dimensional arrays.
      6. Creating array aggregates.
      7. Know what constrained and unconstrained types are, and what you can do with each.
      8. Strings.

    6. Access types.
      1. Dangling pointers are bad.
      2. Pool-specific: Creation and limitations.
      3. All pointers.
      4. The reference attribute and the aliased declaration.
      5. Accessibility rules.
      6. Access parameters.
      7. Subprogram access types.

    7. Records.

  3. Functions and procedures.
    1. Declaration syntax.

    2. Parameter types and rules for sending parameters.

    3. Use of unconstrained array parameter types.

    4. In, out, and in out parameters.

    5. Default and keyword parameters.

  4. Packages.
    1. Know how to specify a package and a package body.

    2. Know the differences and similarities between a package and a class.

    3. Know that packages can be used to declare one or more types, but they are not themselves types.

    4. Know what a private type is and how to create one.

    5. Know what the private section of a package is, and what goes there.

    6. Know how to overload =.

    7. Know what limited types are, what they do, and why you might want one.

    8. Child Packages.
      1. How to declare one.
      2. What privileges a child package has compared to packages which are not children of the same parent.
      3. Know what a private child unit is, and why you would want one.

    9. Know what separate functions are, and how to declare one.

  5. Know how to use renaming.

  6. Object-Oriented Programming
    1. Understand how Ada uses external notation: f(obj,y) instead of Java-style obj.f(y).

    2. Understand in what sense methods belong to object types.

    3. Know what type extension is and does.
      1. The syntax is type d is new b with ... ;
      2. This creates a type d derived from b
      3. Know how type hierarchies are created in Ada.

    4. Polymorphism.
      1. Know what the tagged modifier does. Know the difference between the tagged and un-tagged versions of a type.
      2. Know what the 'class attribute means, and know what the difference is between procedure P(f: Fred); and procedure P(f: Fred'class);.
      3. Know the rules for conversions (casting) up and down a tree. (Hint: Pretty much just like Java.)
      4. Be able to tell if a call is dispatching or not. Understand the example calls on pp. 284 and 285.
      5. If a call is dispatching, be able to tell what function or procedure is called.
      6. Know how to declare abstract types. Know why an abstract type is generally tagged.

    5. Know how to declare a controlled type.

  7. Exceptions.
    1. Know what exceptions are, and what they are used for.

    2. Know how how to catch an exception. Know the syntax and semantics of exception clause.

    3. Know how to raise an exception. Know the syntax and semantics of raise statement.

    4. Know how to declare exceptions.

    5. Know that an exception handler cannot return to the point of the exception.

  8. Generics
    1. Know how to create a parametric type, as in the linked list of strings example.

    2. Know how to create a record with a variant part, as in the variant example.

    3. Know the rules about declaring variables of a parameterized type.
      1. An ordinary variable may not have a parameterized type unless it is constrained (a value is given for the type parameter).
      2. A function or procedure parameter may have an unconstrained parameterized type.
      3. You may create pointers to unconstrained parameterized types as well.

    4. Know how to create generic packages as in the stack example.

    5. Know how to use a generic package.

    6. Know about generic packages generally:
      1. Understand why generic packages are useful.
      2. Know the differences between implementing a generalized ADT using inheritance or using a generic package.