PROGRAMMING CONCEPTS
Specific objective content
State the differences High level languages Low level languages
between low level
High level programs are easier A low level program is efficient.
language and high level
language to write If a high level program and a
They are also easier to low level program are written
understand and to modify to do the same thing:
High level programs are a) The low level program will
portable. A portable program is run faster.
one which can be run on a b) When the two programs are
number of different types of translated into machine code the
computer with only minor high level program will use more
changes. storage space than the low level one.
Differentiate between Assembler
program translators. - Translates low level language to machine code
- Machine dependant
- Uses less memory
Compiler
- Translates high level language to machine code
- Translates the whole program at once
- Errors are shown at the end of translation
- Compiled program executes faster
- Used once because it stores object code after translation
- More memory used during translation
Interpreter
- Translates high level language to machine code
- Translates each line in succession
- Errors are shown as they are encountered and the translation process stops
until the error has been corrected
- It used every time the program is executed because it does not store the
object code
1
PROGRAMMING CONCEPTS
- Less memory used during translation
State the benefits of Assembler
using different program - Uses less memory during translation
translators.
Compiler
- Compiled program executes faster
- Used once because it stores object code after translation
- More memory used during translation
Interpreter
- Less memory used during translation
Describe structured - This is a way of improving the reliability and clarity of programs
programming
techniques.
State the advantages of - Programs becomes quick to write
using structured - Programs becomes easier to write
programming - Programs are easier to debug
techniques.
Describe the use of The procedures that can be used in writing programs include:
procedures/subroutines. Selection
This is where by there is need to make a decision on either this or that statement. It
uses the if….then…else statement or case statement
Loop/iteration
This is part of the program that requires repletion of statements. The loops that can
be used are:
a) While loop
While(condition)
Statement
End while
b) For loop
For (condition)
Statement
End for
2
PROGRAMMING CONCEPTS
c) Repeat until loop
Repeat
Statement
Until(condition)
d) Do while loop
Do
Statement
While(condition)
Represent algorithms Algorithm: the steps taken in solving a problem.
using pseudo code. e.g. algorithm for printing total of 2 numbers
input number 1 and number 2
add 2 numbers to get total
print total
Pseudocode
Begin
input number1
input number2
total = number1 + number2
print total
End
Draw program flowchart
Start/Stop
symbols
Input/ Output
Decision
Process
These symbols are joined using an arrow to denote the flow of data.