Understanding what a program is
The first step in understanding how to write a program is to understand what a program is. The technical term for a program is algorithm. For the inexperienced, the term algorithm is ambiguous and, for some, scary. However, an algorithm is simply a set of steps. This means the most literal way to think of a program is as a series of steps that a computer or other programmable device will carry out to accomplish a task.
To demonstrate what an algorithm is, consider the steps it takes to withdraw money from an ATM:
- Enter the debit card into the machine.
- Enter the PIN.
- Enter the amount to withdraw.
- Remove the debit card from the machine.
- Take cash and go.
The steps it takes to withdraw money from an ATM is a prime example of an algorithm. Now that we know what an algorithm/program is, what purpose does it serve?
What is the purpose of a program?
The purpose of a program starts with a problem to solve. For our purposes...