faf notes la5 a

4
LEARNING AREA 5 : PROGRAMMING PROGRAMMING = a creation of a set of commands or instructions which directs a computer in carrying a task. PROGRAM = a series of organised instructions that directs a computer to perform tasks. PROGRAMMING LANGUAGE = a set of words , symbols and codes that enables human to communicate with the computers. Ex: ALGOL, BASIC, VISUAL BASIC, C, C++, JAVA, HTML, ADA, PASCAL, COBOL

Upload: fathihanirif

Post on 01-May-2017

218 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: FAF notes LA5 a

LEARNING AREA 5 : PROGRAMMING

PROGRAMMING = a creation of a set of commands or instructions which directs a computer in carrying a task.

PROGRAM = a series of organised instructions that directs a computer to perform tasks.

PROGRAMMING LANGUAGE = a set of words, symbols and codes that enables human to communicate with the computers.

Ex: ALGOL, BASIC, VISUAL BASIC, C, C++, JAVA, HTML, ADA, PASCAL, COBOL

Page 2: FAF notes LA5 a

2 levels

NON-PROCEDURAL LANGUAGE

PROGRAMMING LANGUAGES

LOW LEVEL PROGRAMMING LANGUAGE HIGH LEVEL PROGRAMMING LANGUAGE

FIRST GENERATION LANGUAGE

SECOND GENERATION LANGUAGE

FIFTH GENERATION LANGUAGE

FORTH GENERATION LANGUAGE

THIRD GENERATION LANGUAGE

MACHINE LANGUAGE

ASSEMBLY LANGUAGE

NATURAL LANGUAGE

PROCEDURAL LANGUAGE

Consist of 0,1 (binary code)

CPU can execute directly

Use human-readable notation, symbolic instruction codes, meaningful abbreaviation, mnemonics)

Visual programming language

Allow people to interact with the computer without needing any special knowledge

Ex: Prolog, Mercury

high level languages must be translated to machine language using COMPILER / INTERPRETER

Enable user to access database

Ex: SQL, NOMAD, FOCUS

Use series of english-like words

Ex: PASCAL, FORTRAN, BASIC, COBOL, C, C++

Assembly language translate to machine lang. using ASSEMBLER

** TRANSLATOR translate high level languages to machine language. Example of translator = ASSEMBLER , COMPILER & INTERPRETER

tran

Page 3: FAF notes LA5 a

Translate assembly lang machine lang. Interpreter and compiler translate high level language machine language

Interpret and execute program directly from source code, without compiling it first.

Source code is interpreted in real time, line-by-line until end of program.

Translate the whole/ entire program into machine language, save it as object code and execute it later.

Example of assembler : MACRO-80, Microsoft MASM

Example of programming language that uses interpreter; BASIC, LOGO, SmallTalk

Example of programming language that uses compiler: C++, COBOL, Pascal

TRANSLATORTranslates high level language machine language.

ASSEMBLER COMPILERINTERPRETER

Assembly Language

Machine Language

Assembler

Source Code + Data

Result

Interpreter

Source Code

Object Code

Compiler Error go to program listing files

Result

Data

Page 4: FAF notes LA5 a

PROGRAMMING APPROACH

Structured Approach Object Oriented Approach (OOP)