Docsity

Programming Fundamentals, Summaries of Computer science

Toggle sidebar
bg1
1
PROGRAMMING
§ A program is a sequence of instructions which is designed to perform a certain task is
using the computer.
§ A computer language is needed to provide the instructions.
§ Objective of programming -to make daily work easier.
§ There are two types of languages called;
1. Low level languages
2. High level languages
Low level languages
1. Machine Language
o This is a language which can be directly understood by the computer.
o Binary numbers such as 0s and 1s (bits) are used to provide instructions.
2. Assembly Language
§ Instead of commands written in a machine language using 0 and 1,
assembly language is designed to use simple symbols.
Human readable languages convert Machine Language
§ Since, the computer cannot understand human readable languages, those
languages should be converted into machine language.
§ Because, the computer cannot understand words or letters. They only can
understand 0 and 1(Binary).
pf3

Partial preview of the text

Download Programming Fundamentals and more Summaries Computer science in PDF only on Docsity!

PROGRAMMING

§ A program is a sequence of instructions which is designed to perform a certain task is using the computer. § A computer language is needed to provide the instructions. § Objective of programming - to make daily work easier. § There are two types of languages called;

  1. Low level languages
  2. High level languages Low level languages
  3. Machine Language o This is a language which can be directly understood by the computer. o Binary numbers such as 0s and 1s (bits) are used to provide instructions.
  4. Assembly Language § Instead of commands written in a machine language using 0 and 1, assembly language is designed to use simple symbols. Human readable languages convert Machine Language § Since, the computer cannot understand human readable languages, those languages should be converted into machine language. § Because, the computer cannot understand words or letters. They only can understand 0 and 1(Binary).

§ So, those are converted using language translators. Such as;

  1. Assembler
  2. Compiler
  3. Interpreter § Assembly language and machine language are considered as low-level languages. § High level languages are bit advance than low level languages. Assembler Assembler is used mainly to convert assembly language to machine language. And it is also used to convert low level languages. High Level Languages § Languages which are designed with simple English words enabling the programmer to understand it easily are called high-level computer languages. § Examples for high level languages are; o C++ o Java o Python o PHP § Two types of language translators can be used to translate a program written in a high- level language to machine language instructions. They are:
  4. Interpreter
  5. Compiler § High level languages are easy to understand by a programmer.

1. Interpreter

An Interpreter translates and executes code line by line.

  • Executes immediately after translation
  • Stops when an error is found
  • Slower execution
  • No separate executable file generated
  • Example: Python, JavaScript

2. Compiler