Chapter 2. Remember This: Memory and Variables

What is a program? Hey, wait a minute, I thought we answered that in chapter 1! We said a program was a series of instructions to the computer.

Well, that’s true. But almost all programs that do anything useful or fun have some other qualities:

  • They get input.
  • They process the input.
  • They produce output.

Input, processing, output

Your first program (listing 1.1) didn’t have any input or processing. That’s one reason why it wasn’t very interesting. The output was the messages the program printed on the screen.

Your second program, the number-guessing game (listing 1.2), had all three of the basic elements:

  • The input was the guesses the player typed in.
  • The processing was the program ...

Get Hello World! Second Edition: Computer Programming for Kids and Other Beginners now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.