0% found this document useful (0 votes)
7 views9 pages

Chapter 4- Programming Languages and Software Development Tools

Uploaded by

golsiaraoul9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
7 views9 pages

Chapter 4- Programming Languages and Software Development Tools

Uploaded by

golsiaraoul9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 9

TOPIC: ALGORITHMS [PROGRAMMING LANGUAGES & SOFTWARE DEVELOPMENT ]

Chapter 4: Programming languages and Software development


Tools
Learning objectives : after studying this lesson , the students should Be able:

Objectives

 Define computer program , programming paradigms


 List the classes of programming languages with examples
 Differentiate between Low level languages and High Level languages
 Give the role of programming language translator such as Compiler, assembler,
interpreter

4.1. Introduction

.Programmers use many different programming languages to communicate with computer


systems. Computers only ‘understand’ their own machine code. A program needs to be translated
into machine code before it can be ‘understood’ by a computer.
A COMPUTER PROGRAM is a list of instructions that enable a computer to perform a
specific task. A list of instructions that direct the computer what to do. Computer programs can
be written in high-level languages or low-level
languages, depending on the task to be performed and the computer to be used.
PROGRAMMING refers to the process of developing or writing computer programs to solve
a specific task.
A PROGRAMMING LANGUAGE is a language used in writing computer programs. The
language must be understood by the computer to execute it. Each programming language has its
own syntax. A syntax is a set of rules that we need to follow when we write a computer program.
In other words is the Grammar of the programming language. There are hundreds of
programming languages used around the world. And new ones are getting developed all the time.
Programming languages can be classified into two main categories: LOW LEVEL
LANGUAGES and HIGH LEVEL LANGUAGES.
Throughout this chapter we will learn the different classes of programming languages and the
Translators.

MR. HOYOKSOU GOLSIA BLAISE RAOUL Page | 1


TOPIC: ALGORITHMS [PROGRAMMING LANGUAGES & SOFTWARE DEVELOPMENT ]

4.2. Low Level Languages (LLL)

The languages are classified as low because they can be easily understood by the computer
directly or they require less effort to translate them into computer understandable form.

Low level languages exit in two types:

 MACHINE LANGUAGES( First generation language)


 ASSEMBLY LANGUAGE ( Second generation language)

4.2.1. MACHINE LANGUAGE ( First generation language: 1GL’s)

In this language, instructions are written using binary logic. Given that data and instructions
are in binary form, many lines of codes are needed to accomplish a simple task. For example for
adding two numbers the program written in machine language look like this.

11100110 00000011
00001111 10001101
10001111 11111111
The program is hard for human to understand but it’s easily understood by computers. A
machine code is directly executed by the computer’s processor.

4.2.2. ASSEMBLY LANGUAGE ( Second generation language: 2GL’s)

This language was developed to overcome the difficulties of understanding and using machine
language. It helps the programmers to write programs as a set of Symbolic operation Codes
called Mnemonics.
Mnemonics are basically shortened two or three letter words. A sample program written in
assembly language is shown below.
MOV AX, 15 - (means move 15 to register AX)
SUB AX, 10 -( Subtract 10 from the value in AX)
Programs written in assembly language required an assembler to convert them into machine code
for the computer to execute them.

4.2.3. Advantages and disadvantages of Low Level Languages


A. Advantages
 The CPU understands machine language directly without translation.
 Running a program is fast, no compilation is needed
 They are stable and hardly crash.
 They use less amount of memory space.

MR. HOYOKSOU GOLSIA BLAISE RAOUL Page | 2


TOPIC: ALGORITHMS [PROGRAMMING LANGUAGES & SOFTWARE DEVELOPMENT ]

B. Disadvantages
 They are machine dependent , they are not portable that means a program written for
one computer can not be installed and used on another computer of different family.
 They are difficult and cumbersome to use and learn
 Require highly trained experts to both develop and maintain programs
 Debugging program is difficult

4.3. High Level Languages (HLL)

These languages are very close to the human language (English – like) and they can be read and
understood even by people who are not experts in programming.
The following statement written in High Level Language adds two numbers. It shows how easy
it is to understand.
Sum := FirstNumber + SecondNumber.

A source code is a program written in High Level Language or Assembly Language that a
programmer enters through a source code editor.
There are many different high-level programming languages in use today including
C++, Delphi, Java, Pascal, Python, Visual Basic and many more. Once a programmer
has learnt the techniques of programming in any high-level language, these can be
transferred to working in other high-level languages.

Web scripting languages

These languages are used to create web pages. The standard Markup language used to create
web pages is called HTML( Hyper Text Markup language). The HTML consists of tags.
Examples of HTML tags and meaning.

MR. HOYOKSOU GOLSIA BLAISE RAOUL Page | 3


TOPIC: ALGORITHMS [PROGRAMMING LANGUAGES & SOFTWARE DEVELOPMENT ]

Some special block of codes called scripts may be inserted into HTML pages using scripting
languages. Some examples of web scripting languages are: HTML, JavaScript, and CSS.

4.3.1. Advantages and disadvantages of HLL


A. Advantages

High-level languages are designed with programmers in mind;

 programs written in a high-level language are easier to read and understand as the
language used is closer to human language
 Programs are written in a shorter time
 It easy to maintain once in use.
 Programs are portable (not machine dependent).
B. disadvantages
 programs are executed more slowly
 Require larger CPU storage capacity for compilation.
 They have to be translated into machine readable form before.

4.4. Translators
Computer programs can exist in several forms. Programs are written by humans in a form that
people who are trained as computer programmers can understand. In order to be used by a
computer, programs need to be translated into the binary instructions, or machine code, that the
computer understands this is done by a utility program called a translator.
Examples of translators are:
 Compilers
 Interpreters
 Assemblers
4.4.1. Compilers

A COMPILER is a computer program that translates a program written in a high-level language


(HLL) into machine code so that it can be directly used by a computer to perform a required task.
The process of translating a source program written in HLL into machine language is called
Compilation. Once a program is compiled the machine code can be used again and again to
perform the same task without recompilation.

High Level Language Program Compiler Machine Language

Sum := FirstNumber + SecondNumber 0001 00010010


Becomes after compilation 0100 00010011
0000 00011010

.
MR. HOYOKSOU GOLSIA BLAISE RAOUL Page | 4
TOPIC: ALGORITHMS [PROGRAMMING LANGUAGES & SOFTWARE DEVELOPMENT ]

4.4.2. Interpreters

An Interpreter is a computer program that reads an instruction from a program written in a


high-level language, convert it into machine code and execute it before going to the next
instruction.

4.4.3. Assemblers

An ASSEMBLER is a computer program that translates a program written in an assembly


language into machine code so that it can be directly executed by a computer’s processor. Once
a program is assembled the machine code can be used again and again to perform the same task
without re-assembly.
Program in Assembly Language Assembler Machine Language

LDA First 0001 00010010


ADD Second Becomes after translation 0100 00010011
STO Sum 0000 00011010

4.4.4. Differences between compilers, interpreters and assemblers.

MR. HOYOKSOU GOLSIA BLAISE RAOUL Page | 5


TOPIC: ALGORITHMS [PROGRAMMING LANGUAGES & SOFTWARE DEVELOPMENT ]

4.5. Types of errors in programming


As programs are written by humans, they may contain errors. There are several different types of
error for instance Syntax error, logic error and run time error .

4.5.1. Syntax Error


A system error is where a program statement doesn’t obey the rules of the programming
language. A program cannot be translated if it contains syntax errors.
Examples of syntax errors include:
 Undeclared variable
 Missing semi-colon at the end of a statement
 Misspelling a command or a keyword.
When a program is being compiled, if any syntax errors are found no translated program is
produced. Instead, a list of all the errors in the whole program is produced. The programmer
corrects these errors and recompiles the program.

4.5.2. Logic Error


A LOGIC ERROR is where the program doesn’t do what the programmer wanted it to do.
Logic errors are found when a program is being run. These can be found by tracing what the
program does and using test data with expected results.

4.5.3. Run time Error


Run time errors are mistakes that occur when you run the program and it directs the computer to
execute an illegal operation for example dividing a number by 0.

4.6. Software Development Tools

These are software used for developing application (programs) there are different kind of
software tools for instance translators, editors, debuggers , linkers and IDEs.

A. Text editor

An editor is a piece of computer software for creating and editing plain text. It does not support
document formatting as the word processor does. A text editor can be used to write email,
compose web page, write computer program. For example Notepad, Wordpad.

B. Source code editor

A source code editor is a text editor designed specially for editing source code of computer
programs. I could be a stand alone application or may be built into An Integrated Development
Environment(IDE).

MR. HOYOKSOU GOLSIA BLAISE RAOUL Page | 6


TOPIC: ALGORITHMS [PROGRAMMING LANGUAGES & SOFTWARE DEVELOPMENT ]

C. Linkers

A linker is a software that is used to combine object code modules ( sub programs) together to
make a complete program.

D. Debugger

A software bug is an error ,mistake ,failure or fault in a computer program that produces an
unexpected result.
A debugger is a software that is used to remove bugs from a program. The process of removing
bugs or mistake from a program is called debugging.

E. Integrated Development Environment( IDE)


An IDE is an application software that provides facilities to computer programmers for software
development. An IDE normally consist of:
 A source code editor,
 A compiler and /or an interpreter,
 Automation tools,
 A debugger
Examples of IDEs include: Eclipse, Netbeans, Microsoft Visual Studio, Windev, Dev C++ ,
Code Blocks.

1.1. Programming Paradigms

A programming paradigm is a fundamental style, or methodology of computer programming.


These include: imperative(procedural), functional, logic and Object Oriented paradigms.

 Imperative paradigm: programs are written using sequence of instructions that are
executed by the processor; it manipulates variables and data structures. C, PASCAL,
FORTRAN are example of imperative paradigm programming languages.
 Functional paradigm: Here, programs development is the construction of mathematical
functions. A solution to a problem consist of series of functions calls. E.g Lisp,ML.
 Logic paradigm: logic programming consist of set of facts and rules. A knowledge base
is built up trough facts and rules about a specific area of expertise. E.g PROLOG.
 Object Oriented Programming (OOP): The concept behind OOP languages is to look
at a program as having various objects interacting together to achieve a common goal.
Each object has a specific data values that are unique to it ( called State) and a set of the
this it can accomplish called ( functions or behavior). This process of having data and
functions that operate on the data within an object is called Encapsulation. Examples of
OOP languages are Java , Simula, Python

MR. HOYOKSOU GOLSIA BLAISE RAOUL Page | 7


TOPIC: ALGORITHMS [PROGRAMMING LANGUAGES & SOFTWARE DEVELOPMENT ]

END OF CHAPTER QUESTIONS


1. Differentiate between Low level Language and High Level Languge.
2. List four characteristics of High Level languages.
3. State the function of a compiler.
4. Consider the two program below:

a) Which program is easier to understand?


b) Why is it easier to understand?
c) Which program is written in a high-level language?
5. Give three advantages of writing a program in a high-level language rather than using a low-
level language.
6. Give three advantages of writing a program in a low-level language rather than using a high-
level language.
7. Explain what a compiler does and what an interpreter does. In your explanation include a
description of the differences between them.
8. Choose which type of translator you would use to develop a program written in a high-level
programming language. Give three reasons to support your choice.
9. High-level languages can be compiled or interpreted. Give two differences between a
compiler and an interpreter.
10. Give four features( characteristics) of Low Level language.

Cambridge IGCSE Computer Studies 7010/0420 Paper 12 Q13 June 2012

MR. HOYOKSOU GOLSIA BLAISE RAOUL Page | 8


TOPIC: ALGORITHMS [PROGRAMMING LANGUAGES & SOFTWARE DEVELOPMENT ]

MR. HOYOKSOU GOLSIA BLAISE RAOUL Page | 9

You might also like