A program inputs data from somewhere, does computations with the data, and outputs the result.


Data needs to be transformed into other data.


Choose some variables for input, and for output. Write processing code to convert input to output.


Input-process-output works best when there isn't much user interaction. This is common. Data might be in a file, or a database, a spreadsheet, whatevs. All users have to do is start the program, and maybe tell it where to get data from.


  • Convert feet into meters
    • Get feet
    • Compute meters
    • Output meters
  • Compute the average of some data
    • Read the data
    • Compute total and count
    • Compute average
    • Show average

Use this pattern for an entire program, or part of one. For example, someone uses a program to take an online quiz. There's user interaction as the quiz is being taken, with data being stored in a database. After the quiz, the program uses input-processing-output to report quiz results to the user.

Where referenced