5th Week History and Def C++ Language1
5th Week History and Def C++ Language1
++using C
3
LANGUAGE?
Language is a source of communication between people.
It is medium of Expression
What is the computer language?
To establish a communication between user and computer .
In general, there are two classes of languages
Natural languages
Programming Languages
4
Natural languages
These are the languages through which the human beings
communicate with each other.
For example: English, Farsi, Urdu, French, Pashto etc.
Programming languages
These are the languages through which the human beings
communicate with the computer.
These are the most widely used mediums between the user and
the computer. Examples are C, C++, COBOL, PASCAL, BASIC, FORTRAN etc.
The programming languages are classified into two types:
1) Low level languages.
2) High level languages
5
1) Low-Level Language
It consists of two types of languages
Machine language
Machine Language was the first language used for computers as a source
of communication
This is the only language which is directly understandable by the machine (computer)
and needs no translation programs (compiler, Assembler, Interpreter).
Machine language is the language of binary digits 0’s and 1’s(“0” means “OFF” and “1”
means “ON) that is why it is also called as binary language.
It is very difficult to write programs using 0’s and 1’s i.e. in machine language.
Thus machine language is totally machine dependent and is efficient for computers and
inefficient for programmers.
6
Main Points of Machine language
The first language that was invented.
It is machine dependant.
It is also called binary language.
It is the most complicated and hard language.
A program created in machine language
cannot be run on any other computer
• Machine language depends on electric pulses
(i.e on / off).
7
ASSEMBLY LANGUAGE
The computer professionals developed one step higher language than the machine
language which is called Assembly language .
The binary codes of machine language (0’s and 1’s) were replaced by some special codes
called mnemonics.
The programs in Assembly language are written using these mnemonic codes as: ADD for
addition, SUB for subtraction MUL for multiplication
These mnemonics are understandable by the human but not understandable by the
machine.
To make it understandable for the machine, a program called assembler is developed its
function is to translate a program written in assembly language into machine language
8
Main points of Assembly Language
it is one step easy then machine language.
It is also called symbolic language (abbreviation are used).
It is machine dependent.
Slow and tedious language.
Special words are used as symbols called MNEMONICS.
A program created on one computer cannot run on another type
of computer.
9
2) High Level Language
These languages are fairly
machine independent and English like.
10
Main Points of High Level Language
It is English oriented language.
It is much easy to learn.
High level program is just like giving instruction
to a person in daily life.
High level program need preprocessor to
convert the program into machine codes.
Different types of programming languages are
FORTRAN, Pascal, C and C++ etc
11
The high level languages are of two types:
• Procedural languages/Structured languages.
• OOP (Object Oriented Programming) languages
OOP
In this language different objects are created from each other and then used in
different functions
12
Programming Language
Characteristics
Programming languages have some characteristics that describe how
they
work and provide information about the types of computing tasks for which
they are appropriate.
13
Characteristics of High Level languages
14
Fewer errors
In case of high-level languages, since the programmer need not write all the small steps
carried out by the computer, he is much less likely to make an error.
The computer takes care of all the little details, and will not introduce any error of its own
unless something breaks down.
Furthermore, compilers are so designed that they automatically catch and point out the errors
made by the programmer.
Hence diagnostic errors, if any, can be easily located and corrected by the programmer.
15
Language Translator
Translators are system programs, which translate programs written in any high or
assembly language into machine language (1’s and 0’s).
16
Language Translators
Assembler
The software that translates and assembly code into the computer’s machine
code is called assembler
A program written by a programmer in assembly language is called source
program
After this source code has been converted into object code
17
Language Translators
Complier
A compiler is a computer software that translates a whole program, called the
source code at once into machine code (object code)
Interpreter
An interpreter is another type of translator used for translating a language
program into machine code
It takes one statement of program and translates it into a machine instruction
which is immediately executed by computer
--------------
--------------
------C-------
---program- Run on computer
--------------
--------------
---------------
19
Different types of Programs
Generally there are THREE types of Programs that’s are
created in a programming Languages
Source Programs
Object Programs
Executable Programs
20
Source & Object Programs
Source Program:-The program which is written by the user/programmer in a
computer language is called source program.
A Program that is created by user in a high level (C/C++) language with the
extension of CPP/C.
Object program:-The program which is converted into machine
understandable code by the compiler is called object program.
A program that is created by the language processor in the form of codes is
called Object program.
A program that is converted in to object language (Machine) is called object
program
21
Executable Program
A program that is created by language processor to show or
provide the output of a source program.
A program that is directly run or executes to provide results of the
input.
A Program (software) that’s satisfy the user requirements or
provide the solution of the user problem
Executable program:-When source and object program are linked that’s
create a new executable program is called exe program.
22
First.Cpp
24
History in brief
C++ developed by Bajarne stroustrup in 1980 at
Bell laboratories New jursey USA
The first name was c with classes but later on in
1983 a new name was given C++
C++ is an extension to C language
It has similar syntax as C language
But it has the feature of OOP
25
Questions
26