You are on page 1of 35

COMPUTER PROGRAMMING

LANGUAGES
Concept of Program and Programming
Program sometimes known as software .
Program refers as a list of instruction for the computer
to follow to accomplish the task of processing data into
information.
The instructions are made up of statements used in a
programming languages.
Example of programs are application programs that used
by the computer users and system programs that manage
computer system.

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Concept of Program and Programming
Programming also known as software development
Programming is the procedure for creating a list of
instructions to be followed by a computer to carry out
a defined task.
Programming involves six steps which are:
i. Program specification
ii. Program design
iii. Program code
iv. Program test
v. Program documentation
vi. Program maintenance

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
1. Program Specification
 Program specification also known as program
definition or program analysis.
 It involves determine the necessity of the programs
 Program specification involve five task:
 The program objectives
 The desired output
 The input data required
 The processing requirements
 The documentation

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
1. Program Specification task:
a. The program objectives this involve making clear
statement of the problem your trying to solve. Example
recording reporting time of the workers in office. The
problem is late coming.
b. The desired output this involve listing of what you
want to get out of the computer system. Should be
displayed in computer monitor or printed?
c. The input data required, this task done after knowing
the required output. It involve the determination of
input data and the source of that data in order to get
expected output
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
1. Program Specification task:
d. The processing requirements, here you define the
processing task that must happen for input data to be
processed into output.
e. The documentation, as in the system life cycle,
ongoing documentation is essential. The task involve
recording of program objectives, desired outputs,
needed inputs and required processing. This leads to
the next step, program design

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
2. Program design:
 After program specification, designing of the program
follows.
 At this step, programmer plan a solution, preferably
using structured programming techniques.
 There are four structured programming techniques
which are:
I. Top – down program design
II. Pseudo code
III. Flowcharts
IV. Logic structure

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
2. Program design: structured programming techniques:
I.Top – down program design
 When using this technique, you have to determine the
output and input of the computer program that you will
create, then use the technique to identify the program’s
processing step.
 Processing steps are called program modules, each module
(in a form of a box) is made up of logically related program
statement.
 Under the rules of top-down design; each module should
have a single function
 The program must pass in sequence from one module to the
next until all modules have been processed by a computer.
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
2. Program design: structured programming
techniques:
II. Pseudo code
 This involves outline the logic of the program which
created/Designed.
 It like doing a summary of the program before it is
written.
 It allows programmer to arrange required task to be
done by the program expected to be created

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
2. Program design: structured programming
techniques:
III. Flowchart
 This concern with program flowchart.
 These graphically present the detailed sequence of the
steps needed to solve a programming problem.

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
2. Program design: structured programming techniques:
IV. Logic Structure
 This design link various part of the flowchart combining
three logic structure which are known as Sequence,
Selection and loop.
 Sequence structure: One program statement follows another.
There is no question of yes or no of a decision suggesting other
consequences
 Selection structure: Occurs when a decision must be made.
 This structure is also known as IF-THEN-ELSE structure
 Loop structure: Describe process that may be repeated as long as
a certain condition remain true. The structure is called a loop
because the program loops around again and again. Eg Do……
until…../ do……while
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
3. Program Code
 Coding is the actual writing of a program
 After designing program, writing it follows
 Coding can be done through pencil and paper or typing
on a computer the letters, numbers and symbols that
make up the program
 Program are written by using the appropriate computer
languages.
 These languages uses symbols, words and phrases that
instruct a computer as how to display information to
the user.

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
4. Program Test
 This involves running the program on a computer and
then fixing the parts that do not work.
 Sometimes known as Debugging where programmers
test the program and eliminate errors (getting the bugs
out)
 Programming errors are of two types:
 Syntax errors which is the violation of the rules of the
programing language. Example in C++ each statement must
end with a semi-colon, so if the semi colon is omitted, the
program will not run due to the syntax error.
 Logic error, this occurs when the programmer uses an
incorrect calculation or leaving out a programming procedure.
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
4. Program Documentation
 This involve writing descriptions and procedures about
a program and how to use it.
 Program documentation is not done at the end of
programming process, it is carried out throughout all
the programming steps
 This documentation is typically within the program
itself and in printed documents.
 At this step, all the prior documentation is reviewed,
finalized and distributed
 It is important to document each step for the future use.

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
4. Program Documentation
 Importance of program documentation
 Users
 They need to know how to use the softaware. Also can be used
for training then to use or operate the program
 Operators
 Documentation is important for them especially when program
face problem or bring error message
 Programmers
 Can use the document for updating the program or servicing it.

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming steps
5. Program Maintenance
This is the final step. The purpose of program
maintenance is to ensure that current programs are
operating error free, efficiently and effectively.
Activity in this step done in two categories:
 Operations
 This involves locating and correcting operational errors,
making program easier to use and standardizing software using
structured programing technique.
 Changing needs
 This involving updating the program depending on the need of
the users, new information or changes in policies.
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Quiz
1. What is programing?
2. Mention steps to follow in programming
3. Outline structured programming techniques for
program design
4. Point out activities to be carried during program
specification

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
Programming languages these are languages which
used to develop (Creating) list of instructions to be
followed a computer to perform a certain task.
At the level at which computer operates, a program is
simply a sequence of numeric codes (0’s and 1’s), each
one of these codes directly converted by the hardware
into some simple instruction. These codes are made by
using specific Languages.
The programs can be written in a variety of
programming languages depending on the levels and
generations.
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
Languages are broadly classified into two categories:
Low-level languages
High-level languages
The programming languages are called low level when
they are closer to the language the computer itself
uses. The computer understand 1’s and 0’s that make
up bits and bytes.
The program languages are called high level when
they are closer to the language human use –that is, for
speakers, more likely English.

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
Furthermore, programming languages have five
generations which are:
1st G: Machine Languages
2nd G: Assembly Languages
3rd G: Procedural Languages
4th G: Problem oriented Languages
5th G: Natural Languages

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
LANGUAGE LEVEL GENERATIO
N

Machine Languages LOW FIRST

Assembly Languages LOW SECOND

Procedural Languages HIGH THIRD

Problem oriented HIGH FORTH


Languages
Natural Languages HIGH FIFTH

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Machine language
 This is the first generation computer languages and low level
programming language.
 It is using typical machine language that consisted of 0’s and 1’s.
 The 0’s and 1’s make up a byte, and they are correspond to
electricity’s being on or off in the computer.
 They may also correspond to a magnetic changes’ being present
or absent on storage media such as disk or tape.
 From this two-state system coding schemes have been developed
that allows us to construct letters, numbers, punctuation marks
and other characters.
 Example of machine languages are ASCII and EBCDIC
 Example:
111100100111001111010010000100000111000000101011
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Machine language
Advantage:
They are high efficient and allow direct control of each
operation
Does not need another software to interpret languages
eg. Human to machine languages and verse versa.
Disadvantage:
The language is too difficult to write and debug (repair)
The writing process is tedious and time consuming
Possibility of error occurrence is high
They are designed to work with specific machines

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Assembly language
 It is the second generation language and low level
programing language.
 Assembly language unlike machine languages, it use
abbreviations or mnemonics or acronyms in writing the
program.
 Such abbreviations and mnemonics are as ADD, SUM which
later converted to machine languages to be processed by the
computer.
Example: ADD 210(8,13),02B(4,7)
 The program which convert assembly language to machine
language (1’s and 0’s) known as Assembler
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Assembly language
Advantages:
They are closer control over the computer hardware and
executes very efficiently
They are appropriate to write programs which require fast
and efficient use of the CPU like Operation systems and
games
They are likely easy for human to understand and to use
compared to machine language.
Disadvantages:
They are designed for specific machines and specific
microprocessor, so it is difficult to use the same program
to another computer architecture without rewrite.
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Procedural languages
It is the third generation languages and high level
programming languages.
Procedural languages also known as 3GLs (third
generation languages) or general purpose languages,
it uses normal human languages that are easy for
human to understand and work with it however
requires training in programming
They are design to express the logic-the procedures-
that can solve general problems. So they intended to
solve general problems
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Procedural languages
Example of procedural languages is C++ statement fro
a program that assigns letter grades based on the score
of an exam: if(score>=90) ‘A’
This statement test whether the score is greater than or
equal to 90. If it is, then the letter grade A is assigned
Like assembly languages, procedural languages must
be translated into machine language so that the
computer process it.
Depend on the language, this translation is performed
by either a compiler or an interpreter

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Procedural languages
A compiler convert the programmer’s procedural
languages program called the source code, into a
machine language code, called the object code.
The object code can be saved and run later. Example of
procedural language using compiler are standard version
of Pascal, COBOL and FORTAN
An interpreter converts the procedural language one
statement at a time into machine code just before it is
to be executed. No object code is saved.
An example of procedural language using an interpreter
is the standard version of BASIC
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Procedural languages
 Difference between using compiler and using an interpreter.
 When the program is run, the compiler requires two steps.
First step is to convert the entire program’s source code to
object code. The second step is to run the object code.
 The interpreter in contrast, convert and runs the program
one line at a time.
The advantage of a compiler language is that, once the
object code has been obtained, the program executes faster
The advantage of an interpreter language is that, program
are easier to develop.

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Problem oriented languages
It is the forth generation languages and high level
programming languages.
It also known as 4GLs and very high level languages,
required little special training on the part of the user.
Unlike Procedural languages, problem oriented
languages are designed to solve specific problems.
While 3GLs focus on procedures and how program
will accomplish a specific task, 4GLs are
nonprocedural and focus on specifying what the
program is to accomplish.
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Problem oriented languages
Problem oriented languages are more English-like (human
language), easer to program, and widely used by
nonprogrammers.
 4GLs includes query languages and application generators
Query languages enables nonprogrammers to use certain
easily understood commands to search and generate reports
from a database. One of the most widely used query
languages is SQL(Structured query language).
Eg. SELECT Student FROM ReportLog WHERE Latecomers

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Problem oriented languages
Application generator or program coder is a program
that program that provides modules for prewritten
code. When using application generator, a programmer
can quickly create a program by referencing the
appropriate module(s).
The process reduces the time to create an application.
Example, Access has a report generation application
and a wizard for creating a variety of different types of
reports using database information.

TABORA TEACHERS COLLEGE ICT


DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Natural languages
Natural language is the fifth generation languages and
high level programming languages. Also known as 5GLs.
It is also defined as computer language that incorporates
the concepts of artificial intelligence to allow direct
human communication.
Natural languages would enable a computer to learn and
to apply new information as people do.
 Rather than coding by keying in specific commands,
here allows communicates more directly to computer
using Natural languages or human languages such as
English.
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 Natural languages
Example: Consider the following Natural language
statement that might appear in a 5GL program for
recommending medical treatment
If patient is dizzy, then check temperature and blood
pressure
Recently, the definition of 5GL has been expanded to
include Visual programming languages that provide a
natural visual interface for program development.
The visual interface provides intuitive icons menus, and
drawing tools for creating program code. Example of
programs found in visual are Microsoft Visual Basic.
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24
Programming Languages
 SUMMARY
GENERATION SAMPLE STATEMENT

1ST Machine 1111001001110011110100100001000001110000001010


11
2ND Assembly ADD 210(8, 13),02B(4,7)

3RD Procedural If (score > = 90) grade ‘A’

4TH Problem oriented SELECT Student FROM ReportLog WHERE


Latecomers
5TH Natural and Visual If patient is dizzy, then check temperature and blood
pressure
TABORA TEACHERS COLLEGE ICT
DEPARTMENT - PATRICK B. SITTA 03/17/24

You might also like