0% found this document useful (0 votes)
11 views31 pages

WK2 Lesson1

The document provides an introduction to structured programming, outlining its definition, types of programming languages, and their historical development. It distinguishes between low-level and high-level programming languages, detailing their features, advantages, and disadvantages. Additionally, it discusses various types of high-level languages, including structured, fourth, fifth generation, object-oriented, and web scripting languages, along with factors to consider when choosing a programming language.

Uploaded by

jomanzetec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views31 pages

WK2 Lesson1

The document provides an introduction to structured programming, outlining its definition, types of programming languages, and their historical development. It distinguishes between low-level and high-level programming languages, detailing their features, advantages, and disadvantages. Additionally, it discusses various types of high-level languages, including structured, fourth, fifth generation, object-oriented, and web scripting languages, along with factors to consider when choosing a programming language.

Uploaded by

jomanzetec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

TOPIC 1

INTRODUCTION TO STRUCTURED PROGRAMMING

Presentation by
MANZA JOSHUA KIILU
OBJECTIVES
By the end of the lesson the trainee should
be able to:
 Explain meaning of structured programming
 Identify different types of structured
programming languages
 Explain the historical development of
programming languages

zn'r karich
3 Definition of terms

1. A computer program is a set of coded instructions


given to the computer, and represents a logical
solution to a problem.
2. Programming is the process of designing a set of
instructions (computer programs) which can be used to
perform a particular task or solve a specific problem.
3. A programming language is a set of symbols (a
language) which a computer programmer uses to solve
a given problem using a computer.
Mr Maingi 02/05/2025
4 LEVELS OF PROGRAMMING
LANGUAGES
 The languages are classified into 2 major categories
 Low-level programming languages.
 High-level programming languages.
LOW-LEVEL LANGUAGES
 These are the basic programming languages, which can easily be understood
by the computer directly, or which require little effort to be translated into
computer understandable form.
 They include:
 Machine languages.
MANZA JOSHUA
02/05/2025

 Assembly languages.
Features of low-level language
1. They are machine hardware-oriented.
2. They are not portable, i.e., a program
written for one computer cannot be
installed and used on another computer
of a different family.
3. They use Mnemonic codes.
4. They frequently use symbolic addresses

zn'r karich
Machine languages (1st Generation languages)
Machine language is written using machine codes (binary digits) that consist of 0’s
& 1’s.
A machine code instruction is made up of 2 main parts;
 An Address (operand): It specifies the location (address) of the computer
memory where the data to be worked upon can be found.
 A Function (operation) code: It states to the Control Unit of the CPU what
operation should be performed on the data/item held in the address, e.g.,
Addition, Subtraction, Division, Multiplication,
 advantages
disadvantage

zn'r karich
Assembly language (2nd Generation
Languages).
Assembly languages were developed in order to
speed up programming (i.e., to overcome the
difficulties of understanding and using machine
languages).
advantages
disadvantages- individual
assigment

zn'r karich
Advantages of Low-level languages
 They require less memory space.
 Low-level languages are stable, i.e., they do not crash
once written.
 The CPU can easily understand machine language
without translation.
 The program instructions can be executed by the
hardware (processor) much faster. This is because;
complex instructions are already broken down into
smaller simpler ones.
 Low-level languages have a closer control over the
hardware, are highly efficient & allow direct control of
each operation.
zn'r karich
Disadvantages of Low-level languages
 Relating the program & the problem structures is difficult, and therefore
cumbersome to work with.
 The programs are very long; hence, writing a program in a low-level language is
usually tedious & time consuming.
 Low-level languages are difficult to learn, understand, and write programs in
them.
 Low-level language programs are difficult to debug (remove errors from).
 Low-level languages have a collection of very detailed & complex instructions
that control the internal circuiting of the computer
 Low level languages are machine-dependent (specific), hence non-portable.
It is not easy to revise the program, because this will mean re-writing the program
again.
The programs are difficult to develop, maintain, and are also prone to errors.
MR MANZA
HIGH-LEVEL PROGRAMMING LANGUAGES
High-level languages were developed to solve (overcome) the problems
encountered in low-level programming languages
Programs written in a high-level language cannot be obeyed by the
computer hardware directly. Therefore, the source codes must be
translated into their corresponding machine language equivalent .

zn'r karich
Features of high-level programming languages.
 They contain statements that have an extensive vocabulary of words,
symbols, sentences & mathematical expressions
 They require one to obey a set of rules when writing the program.
 Programs written in high-level languages are shorter than their low-
level language equivalents.
 The programs are portable between different computers.
 Allow modularization (sub-routines).
 They are ‘user-friendly’ and problem-oriented rather than machine-
based.

zn'r karich
Purpose of High-level languages.
To improve the productivity of a programmer.
i. To ease the training of new programmers, since
there is no need to learn the detailed layout of a
procession/sequence.
ii. To speed up testing & error correction.
iii. To make programs easy to understand & follow.

zn'r karich
Advantages of High-level languages.
 They are easily portable, i.e., they can be transferred between computers of
different families and run with little or no modification.
 High-level language programs are short, and take shorter time to be translated.
 They are easy to debug (correct/remove errors), & maintain.
 High level language programs are easy to modify, and also to incorporate
additional features thus enhancing its functional capabilities.
 They are ‘&user-friendly’ problem-oriented
 They enable programmers to adapt easily to new hardware
 High-level language programs are self-documenting,
 High level languages are more flexible;

zn'r karich
Disadvantages of using High-level
languages
 High-level languages are not machine-oriented; hence, they do not use of
the CPU and hardware facilities efficiently.
 The languages are machine-independent, and cannot be used in programming
the hardware directly.
 Each high-level language statement converts into several machine code
instructions.
 Their program statements are too general; hence, they execute slowly than
their machine code program equivalents
 The languages cannot be used on very small computers.
 They have to be interpreted or compiled to machine-readable form before the
computer can execute them.
zn'r karich
TYPES OF HIGH-LEVEL LANGUAGES.
1. Third generation languages (Structured / Procedural languages).
2. Fourth generation languages (4GLs).
3. Fifth generation languages (5GLs)
4. Object-oriented programming languages (OOPs).
5. Web scripting languages.
CONT’..

The various types of high-level languages differ in:

 The data structures they handle.


 The control structures they support.
 The assignment instructions they use.
 Application areas, e.g., educational,
business, scientific.
STRUCTURED LANGUAGES

 A structured (procedural) language allows a large program to be broken


into smaller sub-programs called modules, each performing a particular
(single) task. This technique of program design is referred to as
structured programming.
 The 3 basic control structures are:

 Sequence
 Selection.
 Iteration (looping).
Advantages of structured programming

 It is flexible.
 Structured programs are easier to read.
 Programs are easy to modify because; a programmer can change the
details of a section without affecting the rest of the program.
 It is easier to document specific tasks.
 Use of modules that contain standard procedures throughout the
program saves development time.
 Modules can be named in such a way that, they are consistent and easy
to find in documentation.
 Debugging is easier because; each module can be designed, coded &
tested independently
Examples of Third generation
programming languages
 PASCAL
 COBOL
 BASIC
 C
FOURTH GENERATION LANGUAGES (4GL’S)

 4GLs are used to enquire & access the data stored in database systems;
hence, they are described as the Query languages.
Purpose of fourth generation languages.
 To speed up the application-building process, thereby increasing the
productivity of a programmer.
 To enable quick & easy amendments and alteration of programs.
 To reduce development & maintenance costs.
 To make languages user-friendly
CONT’..

 To allow non-professional end-users to develop their own solutions.


 To generate bug-free codes from high-level expressions of requirements.
Examples of 4GLs are:
 Visual Basic
 Delphi Pascal
 Visual COBOL (Object COBOL)
 Access Basic
Advantages of fourth generation
languages
i. They are user-based, and therefore, easy to learn & understand.
ii. The grammar of 4GL’s is very close to the natural English language.
It uses menus & prompts to guide a non-specialist to retrieve data
with ease.
iii. Very little training is required in order to develop & use 4GL
programs.
iv. They provide features for formatting of input, processing, & instant
reporting.
FIFTH GENERATION LANGUAGES (5GL’S).

The 5GL’s are designed to make a computer solve a problem by portraying human-like
intelligence.
5GLs are mostly used in artificial intelligence.
Examples of 5GLs

 LISP (LISt Processing). In LISP, both programs & data


are arranged (structured) as lists. It is used in artificial
intelligence.
 PROLOG (PROgramming in LOGic). PROLOG was
developed from LISP by the Japanese. It is designed for
use with Expert systems & Artificial Intelligence
OBJECT-ORIENTED PROGRAMMING LANGUAGES
(OOPs)

 Object-Oriented Programming is a new approach to software


development in which data & procedures that operate on data are
combined into one object.
 Examples of Object-oriented programming languages are: -

 Simula
 C++
 SmallTalk
 Java
WEB SCRIPTING LANGUAGES

 Web scripting languages are mostly used to create or add functionalities


on web pages.
 Web pages are used for creating Web sites on the Internet where all
sorts of advertising can be done.
 Web pages are hypertext (plain-text) documents written using a
language called HyperText Markup Language (HTML).

 HTML PERL
 JAVASCRIPT PYTHON
 PHP APPLESCRIPT
Comparison of Programming
languages
CONT’..
Factors to consider when choosing a
Programming language
 The availability of the relevant translator
 Whether the programmer is familiar with the language
 Ease of learning and use
 Purpose of the program, i.e., application areas such as education,
business, scientific.
 Execution time. Applications that require quick response are best
programmed in machine code or assembly language.
CONT’…

 Development time. is the time a programmer takes to write and run a


program..High-level languages are easy to read, understand and
develop; hence, they require less development time. Machine code &
Assembly languages are relatively difficult to read, understand and
develop; hence, they are time-consuming.
 Popularity. The language selected should be suitable and/or successful
in the market with respect to the problems to be solved.
 Documentation. It should have accompanying documentation
(descriptions) on how to use the language or maintain the programs
written in the language.
GROUP WORK AND INDIVIDUAL
ASSIGNMENT

Discuss in groups of three:


 Differentiate between high level languages and low level languages
 Differentiate between monolithic program and modular program
 State four disadvantages of assembly language
 State five factors to consider when choosing programming
languages.
THANK YOU

You might also like