0% found this document useful (0 votes)
154 views4 pages

UNIT 1 CHAPTER 5 Programming Language Concept

This document discusses programming language concepts including low-level and high-level languages, syntax and semantics, factors for selecting a programming language, and differences between procedural and declarative approaches. Low-level languages are machine-readable while high-level languages are more human-readable. Syntax refers to grammar rules while semantics refers to meaning. Key factors for language selection include the target platform, flexibility, time to production, and performance. Procedural programming uses procedures to manipulate passive objects, while declarative programming describes logic without control flow.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views4 pages

UNIT 1 CHAPTER 5 Programming Language Concept

This document discusses programming language concepts including low-level and high-level languages, syntax and semantics, factors for selecting a programming language, and differences between procedural and declarative approaches. Low-level languages are machine-readable while high-level languages are more human-readable. Syntax refers to grammar rules while semantics refers to meaning. Key factors for language selection include the target platform, flexibility, time to production, and performance. Procedural programming uses procedures to manipulate passive objects, while declarative programming describes logic without control flow.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

UNIT I

CHAPTER V
PROGRAMMING LANGUAGE CONCEPT

1. What are the features of low-level language?


Low level programming languages
Machine language
This is a language which can be directly understood by the computer. Binary numbers such as 0s and 1s (bits) are used to
provide instructions. Hence, the processor could directly run a program written in a machine language. A program written
in machine language has the following features;
• Could be executed directly on the machine
• Fast in operation
• No need of language translating programs to translate the program into binary
• Dependency on machines (a program written to one computer may not run on another computer)
• Difficult to understand by humans as it is written using 0 and 1.
2. What are the features of high- level language ?
Features of high-level languages High level languages (HLL) are the English like languages where we can make
the use of English words such as if, then, else, for, next, do, while, break, switch while writing the statements in
the program. The languages such as C, C++, Java, Python are high level languages. These languages have
following features.
Ease of understanding – Programs written in HLL are easy to understand as they consist of English natural
words.
Naturalness – The original or natural meaning of the English words is maintained in the HLL. Therefore, they are
very similar that of natural languages.
Portability – Programs written in HLL on one machine can be executed without any modification on another
machine and therefore these programs are portable in nature.
Efficiency of use – It is possible that we can perform efficient programming in HLL i.e. we can keep the size of
the code small and also the time required for its execution is optimized.
3. What is syntax and semantics of the high -level programming languages ?
Syntax: Every HLL has certain grammar. This grammar will tell us how to write program in that programming
language. There are grammatical rules associated with every programming language and it is called as the
syntax of the programming language. It tell us how to write expression, statements or loop in the program.
Observe that syntax consist of production rules that contain terminal and non-terminal symbols.

Semantics: Every construct of the programming language has certain meaning associated with it. It is called as
the semantics of the programming language. It is described by what happens when that construct is executed by
the computer. Semantics can be described by variety of way such as operational semantics, axiomatic semantics
and denotational semantics. Figure … shows the typical operational semantics of the programming
language.Observe that the meaning of loop is described in operational semantics.

4. What are the factors of selection of programming language?


Selection of programming language
The factors are the (i) targeted platform (ii) elasticity of language (ii) time to production and (iv) performance
(I). Platform – It is very much necessary to consider first the platform on which the program will run. For example, if
the program is developed in C language, and it needs to be run on Windows and Linux then it could require the
platform compilers and two different executable files. If the program is developed using Java, then the program can
run on any machine provided JVM (Java Virtual Machine) is installed.

(II). Elasticity of language – the selected language must be elastic in the sense that the new
features can be easily added to the existing program. If the programming language do not provide the
mechanism to add the new features to existing program then such language must be avoided for the development
of the new program.
(III). Time to production – the time taken to make the program so that it can go live is called as time to production.
It is highly dependent upon the size of the code. Always one can find that size of the code for the live projects is
huge and the time allotted for the development is very low. In such a case the programmer needs to optimize the
resources so that the final program can be delivered within a time frame.
(IV). Performance – It depends upon the platform on which it runs and also it depends upon the programming
language used in the program. A programmer can check the performance of the language by considering some
similar other projects in which the same language is used for the development.
Python is being considered as the topmost programming language because it can provide all the object-oriented
features such as C++ and Java.

5. What is the difference between procedural and declarative approach ?


ANS:-Difference between procedural and declarative paradigms

(I). Procedural approach – in this approach the program is a collection of procedures or functions. The program is
an active agent that manipulates the passive objects. All the data and variables that are used in this approach are
passive objects. For example, a stone, a book, a lamp or a table or chair can be considered as passive objects or
entities. A passive object cannot initiate action by itself, but it can receive action from the active object i.e. program
(II). Declarative Programming – It is a programming environment in which the logic of computation is expressed
without describing its control flow. It is a method to abstract away the control flow for the logic. This approach is
opposite to that of imperative programming. In this case the programs are built in in such a way that you want to
describe and not on how you want to do. Examples of declarative programming languages are SQL (Structure Query
Language) and ProLog (Programming Logic)

6. What is the difference between compiler, interpreter ?

7. List the programming language that uses complier, interpreter and


both?
The programming language that uses compiler are as below ;
 C
 C++
 C#
The programming language that uses interpreter are as below ;
 PYTHON
 PHP
 PERL
 RUBY
The programming language that uses compiler and interpreter both are as below ;
 JAVA
8. Give the examples of declarative programming languages.
The examples of declarative programming languages are as below ;
1.SQL (Structure Query Language)
2.ProLog (Programming Logic).
Python is not a pure declarative language but it has some flexibility that to an extent it can be used as a declarative
language.
9. Explain the inheritance with real life examples.
Inheritance – In OOP environment an object can inherit the properties of another object. This is called as
inheritance. When a general class is defined then we can define a more specific class that inherits some of the
properties of the general class, but at the same time this class will have certain new characteristics. This concept is
also taken from the real life. For example, the next generation of human beings will always carry certain properties
of earlier generation such as skin color, height and shape of the face. But, at the same time they have something
different which is not there in their earlier generation.
10. What is polymorphism?
Polymorphism – ‘Poly’ means ‘many’ and ‘morphism’ means ‘forms’, i.e. ‘Polymorphism’ means ‘many forms’. In
OOP environment it is possible to define several operations with the same name that can-do different things. This is
called as Polymorphism.
For example, it is possible that we can use the same function name, ‘area’ to compute the area of rectangle and to
compute the area of triangle.
(I)Function overloading:- These are the two different operations but the still same name can be used for these two
operations. This is called as function overloading.
Also, it is possible to use the same operator to perform similar operation for built in data types and user defined
data types.
(II)Operator overloading: That is the operator + can be used for the addition of two integers and also the same
operator can be used for the addition of two complex numbers, where complex number is a user defined data type.
This is called as operator overloading. Function overloading and operator overloading are the two forms of

polymorphism.

You might also like