1. INTRODUCTION TO STRUCTURED PROGRAMMING

DEFINITIONS
1. Programming: is the process of developing computer instructions used to solve a particular task
using a programming language.
2. Programming language: is a set of symbols that can be translated into machine readable form by
the computer when arranged in a given syntax.
3. Syntax: is a special sequence or order of writing set of characters (symbols) in programming language
to perform a given task.
4. Structured programming: it is a style of programming that is based on use of control structures,
subprograms and indentation to create computer instructions.
5. Source program: this is the program code entered by the programmer in programming language
editor’s window that is yet to be translated into machine readable form.
6. Object code: this is the program code that is machine readable form.
7. Translators: these are language processors that covert source code program into object code.
Translators include: assemblers, interpreters and compilers
8. Assembler: this is a language processor that translate assembly language into machine language for a
computer to understand and execute.
9. Interpreter: it is a language processor that translates the source code program line-by-line allowing
the CPU to execute one line before translating the next line. This method of program translation was
used by early computers that did not have enough memory to store the object code as a file.
10. Compiler: it translates the entire source program into object code file that can be made executable by
Linking. The executable can be installed on other computers to perform the task programmed.

Examples of structured programming languages include; C, Pascal, Common Business-Oriented language
(COBOL), Formula Translator (FORTRAN), Ada, Beginners’ All-purpose Symbolic Instructional Code (BASIC)
etc.

HISTORY OF PROGRAMMING LANGUAGES
There are two levels of programming languages, namely; low-level and high-level programming languages.
1. Low-level Programming Languages
These are languages that require less or no translation for a computer to understand, that is, they are
already or almost in machine language. They are hardware-oriented hence not portable (a program written
for one computer can not be used on another). They include:
1. Machine language: It is also called First Generation language. This is a programming language where
program instructions are written using binary digits (bits). Given data and instructions are in binary
form, many code lines are needed to accomplish a simple task.
2. Assembly language: Also known as Second Generation Languages (2GLs). These are programming
languages whose instructions are written using mnemonics. Mnemonics are symbolic operation codes
composed of two or three words. For instance
MOV AX, 15 //Move 15 to register AX
SUB AX, 10 //Subtract 10 from the value in AX
Assembly languages overcame understanding and use of machine languages since they are readable
however, require an assembler to translate them to machine language for a computer to understand.

High-Level Programming Languages
These are languages whose instructions are English-like, can be read and understood even by nonprogrammers. High-level languages are machine independent and therefore the programmer is more
concerned with problem solving rather than how a machine operates. They include: -
1. Third generation languages (3GLs): these are also known as structured or procedural languages. They
emphasize the breaking of program code into smaller units (modules), control structure and indentations. These languages include Pascal, COBOL, BASIC, C, FORTRAN and Ada.

2. Fourth Generation Languages (4GLs): these are programming languages that present the programmer
with graphical tools such as buttons, forms and other tools for easier interface designs. Unlike the 3GLs
where the programmer has to come up with all code everything from scratch, 4GLs allow the
programmer to select the graphical objects (controls) and use them as design on base form. They
include Microsoft Visual Basic, Visual COBOL and Delphi Pascal.
3. Fifth Generation Languages (5GLs): these are languages that used in artificial intelligence that enable a
computer to depict human like intelligence. These languages include PROLOG, Mercury, LISP and
OCCAM.

PROGRAMMING PARADIGMS
These are ways in which programming languages are classified. A given language is not limited to a given
paradigm, for instance, Java supports elements of procedural, object-oriented and event-driven paradigms.
The paradigms include:
1. Unstructured/ monolithic programming: its is a programming paradigm in which all the code of the
program resides in a single large block. These languages do not support splitting of long program into
either functions, subroutines or methods that perform a particular task.
2. Structured programming: it is a paradigm that emphasize the use of control structures, sub programs
and indentation in writing program code. Structured programming does not allow the use of GOTO
statement to change the course of program execution. The languages that support this paradigm
include, Pascal, C, COBOL, BASIC, Ada etc.
3. Object-oriented programming: this is a programming paradigm in which the programmer designs both
data structures and operations applied to the data structures. The pairing of data structures and the
operations that can be performed on them is known as an object. A program therefore becomes a
collection of cooperating objects rather than a list of instructions. OOP languages includes Java, C++,
C#, Python etc
4. Visual programming: this is a programming paradigm where the programmer creates programs by
manipulating program elements graphically rather than textually. Visual programming frees the
programmer from having to write code but provide graphical objects to be used to create the interfaces
instead. Languages that support this paradigm include: Microsoft Visual Basic, Visual C#, Visual COBOL
etc.
5. Internet-based programming: this is a paradigm where the programmer creates web-based
applications. Since HTML is the basic design languages, to enhance HTML and web applications to
support the dynamic we requirements, server-side and client-side programming languages are used.
The languages include: Javascript, Java, PHP, Perl, Python, ASP etc