Please enable JavaScript.
Coggle requires JavaScript to display documents.
INTRODUCTION TO PROGRAMMING - Coggle Diagram
INTRODUCTION TO PROGRAMMING
PROGRAMMING LANGUAGES
LOW-LEVEL LANGUAGE
consists of strings of binary digits or English
abbreviations to represent basic instructions to computer
eg: ADD
Machine Language
Definition
Instructions is written in the form of binary code (1,0)
Advantage:
Readily understood by computer - does not need translator before being executed
Disadvantages:
Very difficult to read and modify by human
Programs are lengthy - only corresponds to one operation at the machine level
Machine-dependent - only be used on the machine it is created for
Assembly language
Definition
Knowns as a mnemonic to represent instruction to computer
eg: Add 2,3,result
Advantage:
easier to learn and understand by human compared machine language
Disadvantages:
Not readily understood by human
Needs to translate first into machine language before being executed
Programs are lengthy - only corresponds to one operation at the machine level
Machine-dependent - only be used on the machine it is created for
HIGH-LEVEL LANGUAGE
easy to learn and use (new generation)
instructions is called statements
eg: area = 5 x 5 x 3.14159
Java, C++, Python, Visual Basic, C, COBOL, FORTRAN, BASIC and Pascal
Advantages:
Instructions are easier for human to learn and understand compared to low-level language
Programs are shorter- single instruction corresponds to many operations at the machine level
Machine-independent - can run on different types of computer and operating systems
Disadvantage:
Language are not readily understood by computers - need translator to translate before being executed
PROGRAMING PARADIGMS
an approach to solving problems
1. Procedural
concept of modular programming
Function:
as a main module -is decide into smaller modules
Example
:
C
Pascal
COBOL
Fortran
BASIC
ColdFusion
2. Object-oriented
paradigm based on objects and classes
- Function:
identifies objects which item can contain both data and the procedures that read or manipulate that data
Example
:
Java
C++
Python
3. Logic
sentences in logical form, expressing facts and rules about some problem domain
- Function:
knowledge base
Examples:
LISP
ProLog
Mercury
Datalog
PROGRAMMING LANGUAGES TRANSLATOR
Definition:
As a program that translate programming source code into machine code for execution
Main function: to translate source code in high-level language and assembly language to machine code
3. Compiler:
translate entire high-level source code into a machine code
Examples:
Java
Pascal
C++
C
Swift
2. Interpreter:
translate high-level source code into machine code (ONE LINE AT TIME)
Example:
Python
HTML
Perl
PHP
Ruby
1. Assembler:
translate assembly language into machine code
eg: Assembly language