Chapter 3 Outcomes
Input of Data


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. standard input device execution phase file input
    syntax errors semantic errors tokens
    input prompt echoed output exponent form of
    a real number
    white space counted repetition conditional repetition
    loop index loop range loop body
    paragraphing or
    pretty printing
    signal or sentinel open to a disk file
    get from a disk file assert eof
    put to a disk file output redirection standard output device
    generating random integers pseudo-random numbers average
    variance Rand.Int uniform distribution

  3. Differentiate between syntactic and semantic errors in programs (3.1).

  4. Explain the details of how a counted loop operates using the ideas of loop index, loop range, and loop body (3.4).

  5. Distinguish between a counted repetition and a conditional repetition (3.4).

  6. Explain the purpose of the assert statement in programs (3.5).

  7. Explain the difference between an end of sequence sentinel and the predefined function eof when inputting data from keyboard or file (3.5).

  8. Discuss the purpose of the close statement in programs (3.6).

  9. Distinguish between the input of tokens (surrounded by white space) and the input of an entire line of characters, or a fixed number of characters, for example :* or :10 (3.7).

  10. Use the rand module to generate simulated integer and string data using ord and chr for the purpose of testing programs (3.8).

  11. Explain what variance is, and what it tells us about the average of a set of numbers (3.9).

  12. Explain how a program can be used to trace the calculation of the variance of generated data (3.9).

Skills Outcomes

  1. Use the get statement to input integer, real, or string data using a variety of prompt styles: same line, separate line, token-at-a-time, line-at-a-time (3.2 & 3.3).

  2. Use either counted repetition or conditional repetition to input sequences of data items of similar data types (3.4).

  3. Input tokens from a file and output tokens to a file. This includes establishing a connection with the file, managing that connection, and managing the input of information from the file (3.5 & 3.6).

  4. Input either entire lines of characters, or a fixed number of characters from a file (3.7).

  5. Use the open, close, assert, get, and put statements as they relate to file management and access (3.5 - 3.7).

  6. Show two alternate ways of using the Rand.Int function to randomly choose letters of the alphabet to compose nonsense words which can be used to test a program which sorts data alphabetically (3.8).