Problem Soving, Topic1, Intro Programming Languange PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

TOPIC 1

INTRODUCTION TO PROGRAMMING
LANGUAGE

(Part 1)
Language ??
Interaction

HUMAN LANGUAGE

:: BAHASA MELAYU ::
:: BAHASA INGGERIS ::
:: BAHASA CINA ::
< Simple said >
:: BAHASA TAMIL :: Programming
Language is
How human interact medium of
interaction
between human
and computer
Interaction

PROGRAMMING LANGUAGE (C, C++, COBOL)

How human and computer


interact
Programming Language

Artificial language composed by a fixed


A set of rules and vocabulary and set of rules is used to
reserved words create instructions for the computer to
follow.
(keywords) that can be
used to tell a
computer what are
There are over 200
the operations to be programming languages
done. in the world. For
example: Cobol, Pascal,
C, C++, and Fortran.
Types of Programming Languages

Consists of code 0 and 1


Machine Language The only language that computer
understands

Uses symbols or mnemonic to represent


Symbolic/Assembly machine language instruction
Language Needs to be translated into machine
language

Resembles human language. E.g. English


Language
High-Level Language Needs to be translated into machine
language
Generation of
Programming
Language
Evolution of Programming Languages
Generation

5 Human Language – 5th Generation

4 Very High Level Language – 4th Generation

3 High Level Language – 3rd Generation

2
Second Generation

1
First Generation

Year
1960 1970 1980 1990
Evolution of
Programming Click here

Languages
1st GL

• Known as Machine languages


• are the only languages
understood by computers.
• pure machine code
• It is almost impossible for humans to
use because they consist entirely of
numbers.
• Example:
10001110010001000
10000010000111000
11100100111001111
1st GL

• The code won’t need


to be translate the
code and it will run
straight away.
1st GL

• Machine language is
machine-dependent.
• A written program for
one computer generally
cannot be executed on
another.
• For example, a
program written in
Apple PC cannot be
run in IBM PC.

Example
Question?
Can you think of any other
real-life application that
may use this concept?
2nd GL
• Known as Assembly Language
• A program which consists of a series of instructions--
mnemonics that correspond to a stream of executable
instructions
• It needed assembler to translate the instruction to
machine language before it can be loaded into memory
and executed.
-Instead of
entering the
numbers into
memory:
54 24 66 9C FE
C2 84 92

- The assembly
language
programmer
can write
something like
this:
LDX 24, [669C]

• Example
Machine language: 10110000 01100001
2nd GL (Hexadecimal: B0 61) convert to:
Assembly language: MOV AL, #61h.
Question?
Can you think of any other
real-life application that
may use this concept?
• Its an imperative language
• Brought many programmer-friendly features to
code such as loops, conditionals, classes etc.
• one line of third generation code can produce
many lines of object (machine) code, saving a
lot of time when writing programs.
Imperative languages - code is executed line by line, in a
programmer defined sequence

3rd GL
3rd GL
• Need
Translator(Interpreter
or compiler) to convert
high level language to
machine language
• Ex : Basic, Fortran,
Cobol, Pascal, C
4th GL

Build to reduce programming effort and Languages - designed with a specific


the time it takes to develop software; purpose in mind;
resulting in a reduction in the cost of software E.g.;
development. • languages to query databases (SQL)
• languages to make reports (Oracle Reports)
• languages to construct user interface (XUL).
• An example of 4th generation programming
type is the declarative language
4th GL • They are non procedural languages

Declarative languages - describe what


computation should be performed and not how to
perform it. Not imperative!
4th GL

• They are described as application


development without programmers
Question?
Can you think of any other
real-life application that
may use this concept?
A programming language that
resembles human language

Known as knowledge-based language

5th GL Translates human instructions into


code (machine language) where a
computer can understand.

User-friendly Graphical User


Interfaces are facilitated.

Very easy to write and modify


program
5th GL
• Execution speed is
low
• Event driven
programs were
introduced.

Event driven - flow of the program is determined


by events such as user actions, sensor outputs, or
messages from other programs or threads
Question?
Can you think of any other
real-life application that
may use this concept?
There are TWO levels of
<Types of Programming Language>
1st generation and 2nd generation are
considered as the LLL.

LOW LEVEL
PROGRAMMING • Is a programming language that provides
LANGUAGE little or no abstraction of programming
concepts.
• It is very close to writing actual machine
instructions.
• Examples of low-level languages are
assembly and machine code.
3rd generation and above are
considered as the HLL.

HIGH LEVEL
PROGRAMMING • Is a programming language with strong
LANGUAGE abstraction from the details of the
computer.
• In comparison to low-level programming
languages
• it may use natural language elements
• be easier to use
• be more portable across platforms
Class Activity 1

• Topic :
✓ Programming
Languages
• Base on your
understanding
✓ Draw a simple mind
map to describe the
hierarchy of
programming
language generations
and group them base
on their levels.
✓ Give ONE suitable
example for each
generation language.
Summary

Programming language is Low Level Language (LLL)


divided into TWO level of Type
High Level Language (HLL)
of Programming Language.

The 1st and 2nd Generation are in the LLL group.

The 3rd Generation and above will be in the HLL group.


Conclusion
End of
Lecture 1 – Part 1

See you next class

Topic :
Describe fundamentals of
programming languages

You might also like