Skip to main content

Section 2.2 What Is Programming?

A program is a sequence of instructions that specifies how to perform a computation on computer hardware. The computation might be something mathematical, like solving a system of equations or finding the roots of a polynomial. It could also be a symbolic computation, like searching and replacing text in a document or (strangely enough) compiling a program.
The instructions (or commands, or statements) look different in different programming languages, but there are a few basic features that appear in just about every language:
input:
Get data from the keyboard, or a file, or some other device.
output:
Display data on the screen or send data to a file or other device.
math:
Perform basic mathematical operations like addition and multiplication.
selection:
Check for certain conditions and execute the appropriate sequence of statements.
repetition:
Perform some action repeatedly, usually with some variation.
Believe it or not, that’s pretty much all there is to it. Every program you’ve ever used, no matter how complicated, is made up of small instructions that look much like these. So you can think of programming as the process of breaking down a large, complex task into smaller and smaller subtasks. The process continues until the subtasks are simple enough to be performed with the electronic circuits provided by the hardware.

Checkpoint 2.2.1.

Checkpoint 2.2.2.

You have attempted of activities on this page.