A program is similar to that recipe, it consists of a set of instructions on how to do something.
For example how to calculate the average of a years test results
The trick to programming is to think logically and methodically.
Going back to everyday tasks. How do you make a cup of coffe?
1) Get cup 2) Fill Kettle with water 3) Boil the water 4) Add Coffee, Sugar and Milk to the cup 5) Add water and stir
There we go. A program for making a cup of coffee.
Yes you may have done it slightly differently, that's ok there are always different ways to accomlish a task but as long as its approached methodically and the end result is accomplished, a cup of coffee is made.
The main steps have to be done in the right order, here its obvios that the water needs to boil before adding the ingredients.
Hang on!
Why is it obvious that the water had to boil?
Oops! This is an assumption we just made. No where in that set of requirements or Spec was it mentioned that the user wanted a HOT cup of coffee.
We assumed that now. This is an example of exactly how methodically you need to be. The user may of wanted, for whatever reason, a cold cup of coffee.
You need to question everything and make sure you get EXACTLY the right specification when writing your program.