Professional Documents
Culture Documents
Miss. Amna
Submitted by:
Kiran Munawar
Roll No:
201465
Program:
B.S Urdu
Part/Semester:
2/3
TABLE OF CONTENTS
Introduction
Flow Chart
Symbols of Flow Chart.
Programming Languages.
Low-Level Languages
High-Level Languages
Languages Processors.
12
Compiler
Interpreter
Assembler
Difference between Compiler and Assembler
3
3
4
8
PROGRAMMING LANGUAGES
Introduction:
The computer programming involves designing the computer
program (software) to solve different kind of problems as well as to control
different operations of the computer. A computer is nothing without a
computer program. A computer program is designed after understanding the
program. We must be clear about the processing steps to be performed by a
computer. It mean that we must understands the logic of the program.
Before writing a computer program, we must learn how to plan the logic of
program.
For example to find out the average marks of a student, the
steps required to solve problem and their sequence are given as under:
The program instructions are written in such a way that the computer can
execute the program instructions in the correct order to solve the problem
successfully.
Thus, to develop correct (or effective) program, the programmer must write
program instruction in the proper sequence. If the program instruction are
3
FLOWCHART
The graphical or symbolic representation of solution of a
problem is called flowchart. In other words, flowchart is graphical
representation of algorithm or pseudopods.
Flowchart is the most commonly used method for describing
the solution of a problem. It is very easy to understand for anyone. It gives a
quick overview about the solution of problem.
Flowchart is similar to the map of a building. The designer
makes a map of building before starting construction on it. Similarly, a
computer programmer draws a flowchart of a problem before writing the
actual computer program for solution of the problem. The programmer
writes the program by following the flowchart.
Basically, Flowchart is a plan to be followed for coding a
program. It is recommended that the students and programmers must
create a flowchart before writing the code of the program. Errors in the logic
for the program can be detected very easily in flowchart.
Symbols of flowchart
Each step in solving the problem is represented by a different
symbol. Each symbol also contains a short description about the step. The
flowchart symbol are linked together with arrows that show the direction of
flow data or control.
The important standard symbols that are commonly used to draw
flowcharts are described below:
1.
Flow Lines
2.
Start/End
START
END
3.
Input/output
A parallelogram symbol is use to represent Input or output step
in
PRINT X etc.
the
INPUT X,Y
flowchart.
Example:
INPUT
X,
PRINT X,Y
4. Processing
is
0 etc.
S=S+10
5.
S=0
Selection
A diamond symbol is used in the flowchart for representing
selection or decision. This symbol is unique in that it has two
arrow coming out of it. One arrow corresponding to Yes or True,
and one corresponding to No or False. The arrows should always
be labeled with True/False or Yes/No.
False
True
5
6.
Connector
to
7.
Off-Page/On-Page connector
This symbol is used for a lengthy flowchart that does not fit on
single page. This symbol shows the continuity of flow chart to
next page. The symbol of Off-Page/On- Page is given below.
8.
Pre-defined process
9.
Remarks
The remarks or comments can also be given in the flowchart.
The
----------------
Flowchart Examples
1.
A flowchart to input two numbers, calculate the sum and prints
the result.
START
INPUT A
INPUT B
C=A+B
PRINT C
END
INPUT A
INPUT B
IF
PRINT- B
A>B
PRINT A
STOP
START
N=2
PRINT N
N=N + 2
IF
N<=20
STOP
PROGRAMMING LANGUAGE
Low-level languages
The programming language that are close to machine code (0s
and 1s) are called Low-level programming language. This language are
difficult to learn and use. The program instructions written in these
language are in binary form. Low-level language provide the programmer
with a high degree of control over hardware but they require are deep
knowledge of the internal structure of the hardware to be used. The example
of low-level programing language are machine and assembly language.
1.
Machine language
2.
Assembly Language
Assembly language is a low-level language. It is very close to
machine language. In this language, programs instruction are
written by using short names (or symbols) Knows as mnemonics
(Pronounced as Ne-Monics). Assembly language facilities for
controlling the hardware.
The program written in assembly language cannot be run
directly
the help
language is
High-Level Language
The programming languages that are close to human languages
are called high-level language. These languages are easy to learn and use.
Example of high level languages are, FORTARN, COBOL, BASICS, PASCAL,
CC++ etc.
Procedural languages.
Non-procedural language.
Object- oriented languages
Procedural languages
Procedural languages are also known as third-generation
languages (3GLs). In procedural languages, the program instructions are
executed in a sequence in which they are written. It means that order of
program instruction is very important. Some popular procedural languages
are FORTRAN, COBOL, PASCAL, LISP, and C/C++.
1. FORTRAN
Fortran stands for Formula Translation. It was the first highlevel languages. It is generally used for scientific purposes and to
solve
mathematical problems.
2. COBOL
Cobol stand for common business oriented language. The high
level languages is used for writing program for business use. It
is very popular in business field
3. PASCAL
10
4. C
C is high-level language. This language is commonly language
used for developing operating systems and application
programs. The popular operating system UNIX, windows,
Macintosh and DOS etc. are developed in C.
5.
LISP
LISP stands for list processing. It is high-level language. It is
used
computer
games.
6.
Basic
BASIC stands for beginners all-purpose symbolic instruction
code. BASIC is a high level
1. RPG
11
2. SQL
the late 1960s but now it has become the most popular approach to develop
software. In object oriented, programming, a program is designed by using
objects. In object- oriented approach, a whole system is divided into a set of
objects. It is an easy and flexible approach for designing and organizing the
program. Now-a-days, most popular and commonly used object
oriented
Low-level languages
High-level languages
12
1
2
3
4
It
It
It
It
7
8
9
1
0
LANGUAGE PROCESSORES
A computer understands instructions in machine code ( i.e. in
the form of 0s and 1s). It is difficult to write computer program directly in
machine code. Today, mostly the program are written in high-level languages
i.e. C, C++, Java, BASIC, PASCAL, etc.
A program written in any high -level programming language ( or
written in assembly language) is called the Source Program.
The source
code cannot be executed directly by the computer. The source program must
be converted into machine code before running it on the computer.
The special translator system software that is used to translate
the program written in high-level language ( or assembly language ) into
machine code is called language translator or language processor.
Every language ha its own language translator program.
13
The language processors are divided into three types. These are
compiler, interpreter, and assembler.
1. Compiler.
The language translator program that translate the complete
source program into machine code as a whole is called compiler.
The C and C++ compliers are best examples of compilers.
The program translated into machine code is called the object
program. The source code is translated into
object
code
translating
it
again.
2. Interpreter
The language translator program that translates the source
code
it
immediately before
It is a time consuming
called
assembler
An assembler performs the translation process in similar way as
compiler. But assembler is the translator program for assembly
language (a low-level programming language), while a compiler
is
5
6
Interpreter
It translate the source code into machine
code statement -by-statement.
It does not create and object file.
Program execution is slow.
Translator program is required to
translate the program each time you want
to run the program.
It is easier to correct the errors in the
source code.
A few high-level programming languages
have interpreter program.
15