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

72 Learn, Revise & Practice ~ Computer Awareness

C H A P T E R

08
PROGRAMMING
CONCEPTS
Program can be defined as a set of instructions 1. Machine Language It is the only language
that need to be executed to accomplish a understood by the computers. Sometimes, it
computing task. A person who writes or referred to as machine code or object code or
performs the program is known as binary language. It is a collection of binary
programmer. Programmer uses some specific digits (0 or 1) or bits that the computer reads
languages to write program which is known as and interprets.
programming languages e.g. C+ +, Java, etc. 2. Assembly Language It is a low level
programming language which is used as an
Programming Language interface with computer hardwares. It uses
It is a set of commands, instructions and other structured commands as substitutions for
syntax use to create a software program. numbers, allowing humans to read the code
Programming language must be simple, easy easier than looking at binary codes.
to learn and use. It must be consistent in terms
of syntax and semantics.
Medium Level Language (MLL)
It serves as the bridge between raw hardware and
Programming languages are mainly categorised
programming layer of a computer system. It is
into three parts which are as follows designed to improve the translated code before it is
executed by the processor. e.g. C.
Low Level Language (LLL)
These programming languages are more High Level Language (HLL)
difficult to understand. It is designed to It is an advanced computer programming language
operate and handle the entire instruction set of that is not limited to one computer, designed for a
a computer system directly which are specific job and is easier to understand. The main
generally used to write the system software. advantage of high level languages over low level
e.g. Machine language and Assembly languages is that they are easier to read, write and
language. understand. e.g. BASIC, C, FORTRAN, Java, Pascal, etc.
Programming Concepts 73

Some High Level Languages and Their Application Areas

Language Year Developer Application Area Nature


FORTRAN (Formula 1957 a team of programmers at Calculation Compiled
Translation) IBM
ALGOL 1958 A commitee of European and Scientific purpose Compiled
(Algorithmic Language) American computer
scientists
LISP (List Processing) 1958 John McCarthy at the Artificial intelligence Compiled and
Massachusetts Institute of Interpreted
Technology (MIT)
COBOL (Common 1959 Grace Hopper Business management, Compiled
Business Oriented string oriented
Language)
BASIC (Beginner’s All 1964 John G. Kemeny and Thomas Programming for Interpreted
purpose Symbolic E. Kurtz at Dartmouth educational purpose
Instruction Code) College in New Hampshire
Pascal 1970 Niklaus Wirth Education Compiled
C 1972 Dennis Ritchie at Bell Labs System programming Compiled
C ++ 1985 Bjarne Stroustrup at Bell System object Compiled
Labs programming
Java 1995 James Gosling at Sun Internet oriented Compiled and
Microsystems programming Interpreted

Terms Related to Programming


Program Documentation
It is a kind of documentation that gives a comprehensive procedural description of a program. It shows as to how
software is written. The program documentation describes what exactly a program does by mentioning about the
requirements of the input data and effect of performing a programming task.

OOPs
OOPs stands for Object Oriented Programming in which programs are considered as a collection of objects. Each
object is nothing but an instance of a class.

De-Bugging
It is the process of locating and fixing or bypassing bugs (errors) in computer program code.
74 Learn, Revise & Practice ~ Computer Awareness

Language Translator Generation of Languages


It helps in converting programming languages to The concept of language generations, sometimes
machine language. called levels, is closly connected to the advances in
technology that brought about computer
IF Per >=33 11100110101
Result = ‘P’
generations. The five generations of language are as
01101111001
ELSE follows
Result = ‘F’ 01110001111
END 01010101010
(i) The first generation languages or 1 GLs are
low level languages like machine language.
(ii) The second generation languages or 2GLs
Language are also low level languages that generally
Translator consist of assembly language.
(iii) The third generation languages or 3GLs are
high level languages such as Java.
The translated program is called the object code.
Depending upon used programming languages, (iv) The fourth generation languages or 4GLs are
the languages that consist of statements
language translator is divided into three categories
similar to the statements of human language.
which are as follows
4GLs are commonly used in database
1. Assembler It converts a program written in programming and scripting programming.
assembly language into machine language.
(v) The fifth generation languages or 5GLs are
Assembly language consists of mnemonic
programming languages that contain visual
code, which are difficult to learn and are
tools, which help to develop a program. A
machine dependent.
good example of 5GLs is Visual Basic.
2. Interpreter It converts a HLL program into
machine language by converting it Error
line-by-line. If there is any error in any line, An error in a program is called bug. It is a term
it stops the execution of the program used to describe any issue that arises unexpectedly
immediately and reports to the user at the that cause a computers not function properly.
same time. Program execution cannot resume
until the error is rectified by the user. Types of Error
Interpreter is very useful for debugging and The types of error are classified into four categories
suitable for novice programmer. This is a which are as follows
slow process and consumes less memory 1. Syntax Error When the rules of the
space. programming language are not followed,the
3. Compiler It converts HLL program into compiler will show syntax error.
machine language, which can be understood 2. Semantic Error Semantic errors are reported
by the processor. For each high level by the compiler when the statements written in
language, the machine requires a separate the program are not meaningful to the compiler.
compiler. A compiler creates a unique object 3. Logical Error Logical errors are those errors
program, i.e. if a source program is compiled, that occur in the output of the program.The
there is no need of that source program presence of logical errors leads to undesired or
because output can be obtained by executing incorrect output.
that object program. Compiler converts the 4. Runtime Error Runtime errors are those
entire HLL program in one go and reports all errors that occur during the execution of a
the errors of the program alongwith the line program.It generally occurs due to some illegal
numbers. operation performed in the program.
Programming Concepts 75

Algorithm Tit-Bits
An algorithm is a step by step method of solving a ■ Visual Basic is an interpreted language.
problem. It is commonly used for data processing, ■ Reserved words are words that a programming
calculation and other related computer and language has set aside for its own use.
mathematical operations. ■ Pseudocode is not a programming language, but
The desirable features of an algorithm are simply an informal way of describing a program. It
(i) Each step of algorithm should be simple. does not follow any syntax strictly.

(ii) It must be in a finite number of steps.


■ Control structure is a statement or block of
statements in a programming language that
(iii) It should be as efficient as possible. determined the control flow or sequence of
(iv) It should be clear in the sense. execution of other instructions or statements.

(v) It should be effective, i.e. it must lead to a


■ Looping is a control structure which is used in a
program to execute a particular set of statements
unique solution of the problem. repeatedly.

QUESTION BANK
1. The instructions that tell a computer how to 5. A factor in the selection of source language is
carry out the processing tasks are referred (1) programmer skill (2) language availability
to as computer [IBPS PO 2015] (3) program compatibility with other software
(1) programs (2) processors (4) All of the above
(3) input devices (4) memory modules
(5) None of these
6. Languages which can easily interact with
the hardware are called
2. A set of rules for telling the computer what (1) High level languages
operations to perform is called a (2) Low level languages
[IBPS PO 2012] (3) Middle level languages
(1) Procedural language (2) Structures (4) All of the above
(3) Natural language (4) Command language
(5) Programming language 7. Machine language [SBI PO 2013]
(1) is the language in which programs were first
3. Which of the following contains specific written
rules and words that express the logical (2) is the only language understood by the computer
steps of an algorithm? [IBPS Clerk 2014] (3) differs from one type of computer to another
(1) Programming language (4) All of the above
(2) Syntax (5) None of the above
(3) Programming structure
(4) Logical chart 8. The use of combination of 1’s and 0’s is
(5) Flow chart feature of which of the following type of
computer language? [IBPS PO 2016]
4. A (n) ……… program is one that is ready to
(1) High Level Language
run and does not need to be altered in any
(2) PASCAL
way. [IBPS Clerk 2013]
(3) Machine Language
(1) interpreter (2) high level
(4) C
(3) compiler (4) COBOL
(5) COBOL
(5) executable

You might also like