Chapter 9 Outcomes
Records, Unions and Sets


After completing this chapter and participating in class, you should be able to accomplish each of the following outcomes.

Knowledge Outcomes

  1. Define each of the key terms listed in the chart below.

  2. record union set
    field type bind
    key swap procedure 2D array of records
    binary files text files skip
    random access files sequential files read, write, mod
    seek, tell union type tag
    enumerated type enum subrange type
    variant base type set of
    all cardinality empty set
    intersection operator union operator difference operator

  3. Show how to define a variable using the type declaration (9.1).

  4. Create an array of records and be able to input and output values to fields of each record in the array (9.2).

  5. Explain possible difficulties when storing and retrieving string items by field (9.2).

  6. Discuss the importance of a key field to records (9.3).

  7. Explain the advantage of being able to move or copy one entire record from one memory location to another (9.3).

  8. Describe the basic principle behind the swap procedure involving two records in an array (9.3).

  9. Describe the basic principles involved in generating a deck of cards and subsequently shuffling the deck (9.3).

  10. Explain how a two-dimensional array is used to both deal and output the deck of cards once it has been generated and shuffled (9.3).

  11. Describe the differences between text files and binary files with respect to the store and retrieve operations that are used (9.4).

  12. Explain the difference between how text files and binary files encode and store information on disks (9.4).

  13. Discuss the advantage of using fixed length records when storing or retrieving binary files (9.4).

  14. Discuss the advantage of using variable length records when storing or retrieving text files (9.4).

  15. Explain the purpose of seek and tell when using binary files (9.4).

  16. Explain why a directory file must be maintained when using binary files (9.4).

  17. Explain the purpose of the skip instruction when used in a get statement while reading binary files (9.4).

  18. Describe the difference between a record type and a union type (9.5).

  19. Explain the purpose of the tag statement when using the union type (9.5).

  20. Describe the relationship between the set type and the variables which are declared based on sets (9.6).

  21. Identify the set relation operator symbols (9.6):

  22. Identify the set operation symbols (9.6):

  23. Describe how sets can be used to output a card hand from a shuffled deck in its proper order (9.6).

Skills Outcomes

  1. Create a record template using the type statement (9.1).

  2. Properly assign values to record fields (9.1).

  3. Show how to add format items to string information so as to store and retrieve by fields (9.2).

  4. Properly create and use the bind construct (9.2).

  5. Create binary files and access them for both read and write operations (9.4).