Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

1.0 Introduction To Programming 2022 2023 A (FINAL)

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

1.

0
INTRODUCTION TO
PROGRAMMING

COMPUTER SCIENCE
SC015
Learning Outcome
At the end of the lesson, students should be able to :
►Define programming language, programming paradigm
and language translators.(L)
Programming Language
► A computer program is a series of instructions that
directs a computer to perform tasks.
► A computer programmer or developer creates and
modifies computer programs.
Programming Language
► Computer do not understand human language, so
programs must be written in a language computer can
use.
► Most programming language developed to make the
programming process easier for people.
► All programs must be converted into instruction the
computer can execute.
PROGRAMMING DEFINITION

Programming Language
► A set of words, abbreviation and symbols that enables a
programmer to give instructions to a computer.
► Every programming language has its own rules for
writing the instructions.
► Every language designed for specific purposes like
scientific applications, business solution or web page
development.
PROGRAMMING DEFINITION

Programming Language
►A programming language is a vocabulary and set of
grammatical rules for instructing a computer or
computing device to perform specific tasks.
► Usually refers to high-level languages, such
PHP, C++, COBOL, Java, Perl.
► Each programming language has a unique set of
keywords (words that it understands) and a
special syntax for organizing program instructions.
TYPES OF PROGRAMMING LANGUAGE

TYPES

EXAMPLES
TYPES OF PROGRAMMING LANGUAGE

Low-level Language : Machine Language


◼ The natural language of a computer.
◼ Consists strings of numbers (ultimately reduced to 1's and
0’s).
◼ Difficult to write.
◼ No need to be translated.
TYPES OF PROGRAMMING LANGUAGE

Low-level Language : Machine Language

Advantages :
▪ Ready for immediate execution.
▪ Instructions are readily understood by the computer.

Disadvantages :
▪ Instructions are extremely cryptic and difficult to learn.
▪ Programs are lengthy.
▪ Machine-dependent.
TYPES OF PROGRAMMING LANGUAGE

Low-level Language : Assembly Language

◼ Consists of English-like abbreviations.


◼ Clearer to humans.
◼ Need to be translated to machine language before the
computer processes it.
◼ Use mnemonics symbols.
TYPES OF PROGRAMMING LANGUAGE

Low-level Language : Assembly Language


TYPES OF PROGRAMMING LANGUAGE

Low-level Language : Assembly Language


Advantage :
▪ Instructions are easier to learn compared to machine
language.

Disadvantages :
▪ Programs are lengthy.
▪ Machine-dependent
- can only be used on machine or computer that is
originally created.
TYPES OF PROGRAMMING LANGUAGE

Low-level Language

WRITTEN IN A MACHINE WRITTEN IN AN ASSEMBLY


LANGUAGE LANGUAGE

0100 add ax, dx


001101 100000 001101 110001
00101 10001 10000 mov a1, b1
01110 mul b1, ax
mov b1, 04h
TYPES OF PROGRAMMING LANGUAGE

High-level Language
◼ Instructions are written using a series of English like words.
◼ Easier to learn than machine language or assembly
language.
◼ Shorter program - a single instruction corresponds to
many operations at the machine level.
TYPES OF PROGRAMMING LANGUAGE

High-level Language
◼ Must be converted to machine language
before they can be executed.
◼ Machine independent – can run on different
types of computers and operating system.
◼ Instruction are coded.
TYPES OF PROGRAMMING LANGUAGE

High-level Language
▪ The equation : wages = rate x hours
can be written in C++ as : wages = rate * hours;

▪ Examples of high-level language :


FORTRAN (for Scientific) , COBOL (for Business),
BASIC, Pascal, Ada, C, C++, Java
TYPES OF PROGRAMMING LANGUAGE
TYPES OF PROGRAMMING LANGUAGE

The Differences
No. High-Level Language Low-Level Language
Consists of English – like words to Consists of binary digits or
1. form instruction. English – like abbreviations to
form instruction.
2. Need translator to convert to Machine language no need
low-level language. translator.
3. Machine independent/ portable. Machine dependent/ not
portable.
4. Easy to learn, modify and near to Difficult to learn, modify and
human languages. far to human languages.
PROGRAMMING PARADIGMS
• Programming paradigm is a
style or “way” of the
programming.
• There are categorized
according to the approach
they use to solve a problem.
PROGRAMMING PARADIGMS

• Different paradigms represent fundamentally different approach


to build solution and specify type of problem using
programming.
• Most programming language fall under one paradigm, but some
languages have elements of multiple paradigms.
PROGRAMMING PARADIGMS

Enter Your
PROCEDURAL LOGIC Screenshot Here

OBJECT ORIENTED
Translator

Assembler Interpreter Compiler


Checkpoint
1. Define programming language.
___________________________________
___________________________________
2. Define programming paradigm.
___________________________________
3. Define language translator.
________________________________

You might also like