44 total
By the end of this topic, you should be able to:
Structured programming means writing programs in a clear, organised way. Instead of putting every instruction in one long block, the program is broken into smaller parts. Each part has a clear job.
This makes a program:
One of the main ways to structure a program is to use procedures and functions. These are both types of subprograms, which means smaller sections of code inside a larger program.
A large problem is often easier to solve if it is split into smaller tasks. For example, a program may need to:
Instead of writing all of this in one place, each task can be placed in its own procedure or function.
This gives the program a better structure. It also means the same code can be reused instead of being written again and again.
A procedure is a subprogram that carries out a task, but does not return a value.
You use a procedure when you want something to be done.
For example, a procedure may:
A procedure is usually called as a separate statement.
Sign in to view full notes