1.2 Program Function and Purpose

8 阅读1分钟

1. Exam Points

  • Identify input data for a purpose.
  • Identify the behavior of a code segment.

2. Knowledge Points

  • (1) Program
    • A program is a collection of program statements that performs a specific task when run by a computer.
    • A program is often referred to as software (QQ, Wechat, etc).
    • A code segment is a collection of program statements that is part of a program.

A program needs to work for a variety of inputs and situations.

  • (2) Input

    • Program inputs are data sent to a computer for processing by a program.
    • Input can come in a variety of forms, such as tactile, audio, visual, or text.
    • An event (mouse click, key press, etc) is associated with an action and supplies input data to a program.
    • Inputs usually affect the output produced by a program.
    • Input can come from a user or other programs.
  • (3) Output

    • Program outputs are any data sent from a program to a device.
    • Program output can come in a variety of forms, such as tactile, audio, visual, or text.
    • Program output is usually based on a program’s input.

3. Exercises