Please enable JavaScript.
Coggle requires JavaScript to display documents.
INTRODUCTION TO PROGRAMMING - Coggle Diagram
INTRODUCTION TO PROGRAMMING
Program definition :
A set of instructions that tells a computer to perform tasks and instructions must be written in a way that the computer can understand.
Created by programmers
Programming language is defined as a set of words, symbols and codes that enables programmer to give instructions to a computer.
Two types of programming languages
I. Low-level languange
II. High-level language
Low-level languange: Languange that consists of strings of binary digits or English- like abbreviations to represent basic instructions to a computer
Two examples of examples of low-level languange : I.Machine Languange
II.Assembly Languange
I. Machine Languange - machine languange is defined as a languange that consists of strings of binary digits ( 1 & 0) to represent instructions to computer.
Advantage of machine language :
i. Instructions created using machine language are readily understood by the computers because it does not need to be translated before being executed.
Disadvantage of machine language :
i. Instructions created using machine language are difficult to learn and understand.
ii. Programs are lengthy because a single instruction of machine language corresponds only one operation at the machine level.
iii. Machine language is machine-dependent; it can only be used on the machine it is originally created for.
II. Assembly Language - assembly language is defined as a language that consists of English-like abbreviations called Mnemonics, to represent instructions to computer.
Advantage of assembly language :
i. Instructions created using assembly language are easier to learn and understand compared to machine language.
Disadvantage of assembly language :
i. Instructions created using assembly language are not readily understood by computers.
ii. It needs to be translated into machine language before being executed.
iii. Programs are lengthy because a sinle instruction of assembly language corresponds to only one operation at the machine level.
iv. Assembly language is machine-dependent; it can be only used on the machine it is originally created for.
High-level Language : Programming language that consists of a series of English like words to represent instructions to computer.
Examples :
i. Java
ii. C ++
iii. FORTRAN
iv. COBOL
v. BASIC
vi. Pascal
Advantage :
i. Instructions written using high level language are easier to understand compared to low-level language.
ii. Programs are shorter because a single instruction of high-level language corresponds to many operations at the machine level.
iii. High level language is machine-dependent; it can run on different types of computers and operating systems.
Disadvantage : i. Instructions created using high level language are not readily understood by computers where it needs to be translated into machine language before being executed.
Programming paradigm : an approach to solve problem using some programming language.
Three paradigm : i. Procedural ii. Object-oriented iii. Logic
Procedural : based on the concept of modular programming
Programmer identifies the major function of a program called the main module and the main module is divided into smaller modules.
Advantages :
i. it makes the program more readable and easier to maintain.
ii. it can reuse the code
Examples :
i. C
ii. Pascal
iii. ColdFusion
Object-oriented : based on objects and classes.
Programmer identifies objects which are items that can contain both data and the procedures that read or manipulate that data.
Advantages :
i. Code reusability
ii. Avoid programming redundancy
iii. Programmers create applications faster
-Examples :
i. Java
ii. C++
iii. Phyton
Logic : a set of sentences in logical form, expressing facts and rules about some problem domains. - Focus on facts stored in memory called the knowledge base.
Advantages :
i. The system solves the proble, so the programming steps themselves are kept to a minimum.
ii. Proving the validity of a given program is simple.
Examples :
i. LISP
ii. ProLog
Programming Language Translators.
Traslator : a program that translates programming source code into machine language.
Types of translators and function :
i. Assembler - translate programs written in assembly language into machine language.
ii. Interpreter - translate high-level programming language into machine language one line at a time.
iii. Compiler - translates the entire source code of high-level programming language into machine language.