0% found this document useful (0 votes)
0 views

21CSV208 - Question Bank Principles of Programming Languages[1]

The document outlines the examination structure for the Principles of Programming Languages course at Sethu Institute of Technology, detailing the question pattern, units covered, and specific questions for each unit. It includes both short answer questions and detailed problem-solving tasks across five units, focusing on various programming concepts and languages. The course aims to assess students' understanding of programming principles, data types, and language design issues.

Uploaded by

kaishwarya978
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

21CSV208 - Question Bank Principles of Programming Languages[1]

The document outlines the examination structure for the Principles of Programming Languages course at Sethu Institute of Technology, detailing the question pattern, units covered, and specific questions for each unit. It includes both short answer questions and detailed problem-solving tasks across five units, focusing on various programming concepts and languages. The course aims to assess students' understanding of programming principles, data types, and language design issues.

Uploaded by

kaishwarya978
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

SETHU INSTITUTE OF TECHNOLOGY, KARIAPATTI

(An Autonomous Institution Affiliated to Anna University, Chennai)


Regulation 2021
Department: Computer Science and Subject name : PRINCIPLES OF
Engineering PROGRAMMING LANGUAGES
Subject code : 21CSV208 Question Pattern : Part B: 20
Part C: 80
Course Coordinator : Mrs.E.Surya Time Duration :3 Hours
PART – A ( 2 Marks)

UNIT - I (Minimum 8 Questions)


1. What are the three fundamental features of an object-oriented programming CO- U
language
2. Define Syntax and Semantics. CO- U
3. Who are language descriptions for? CO- U
4. Describe the operation of a general language generator. CO- U
5. Identify lexemes and tokens of this statement ---value=3*count+20; CO- App
6. What the primary use of attribute grammars? CO- U
7. What is the difference between a sentence and a sentential form? CO- U
8. What is the l value and r value of a variable? What is Block CO- U
UNIT - II (Minimum 8 Questions)
1. What are the advantages and disadvantages of decimal data types? CO- U
2. What are the design issues for arrays? CO- U
3. Define type error. CO- U
4. What is a ternary operator? CO- U
5. What is a prefix operator? CO- U
6. What is a conditional expression? CO- U
7. What is short-circuiting evaluation? CO- U
8. What are the design issues for unions? CO- U
UNIT - III (Minimum 8 Questions)
1. What is the difference between an activation record and an activation record CO- U
instance?
2. Define shallow and deep binding for referencing environments of subprograms CO- U
that have been passed as parameters.
3. What are the three general characteristics of subprograms? CO- U
4. What are formal parameters? What are actual parameters? CO- U
5. What are the differences between a function and a procedure? CO- U
6. What is Dynamic scoping CO- U
7. Write down the design issues of functions. CO- U
8. What are the fundamental design considerations for parameter-passing CO- U
methods?
UNIT - IV (Minimum 8 Questions)
1. What are the problems with concurrency? CO- U
2. Differentiate process and thread? CO- U
3. Explain the following a) Event b) Semaphores CO- U
4. What is Object oriented programming? What are its key concepts? CO- U
5. Explain the following terms : (a) Message passing (b) Monitors CO- U
6. What is a Preprocessor directive? CO- U
7. Define exception handling CO- U
8. What is concurrent programming? CO- U
UNIT - V (Minimum 8 Questions)
1. What is a curried function? CO- U
2. Explain the process of currying. CO- U
3. What are the two forms of DEFINE? CO- U
4. What does the abbreviation REPL stand for? CO- U
5. What is a simple list? CO- U
6. What is the use of the assert statement? CO- U
7. What is the use of Suppress pragma in Ada? CO- U
8. What does lambda expression specify? CO- U
PART – B
UNIT - I
1. Explain about parse tree with example. CO - U (16)
2. Using the following grammar show a parse tree and leftmost derivation for the
following statement:
A=A*(B+(C*A))
<assign>→ <id>=<expr>
<id>→ A|B|C CO - App (16)
expr>→ <id>+<expr>
|<id>*<expr>
|(<expr>)
|<id>
3. Draw a parse tree for the following statements
a. S -> AB
A -> c/aA
B -> d/bB
Input String - abcd CO - App (16)
b. S -> sAB
A -> a
B -> b
Input String - sab

2
4. Write a grammar for the language consisting of strings that have n copies of the
letter a followed by the same number of copies of the letter b, where n>0.
a. For example, the strings ab, aaaabbbb, and aaaaaaaabbbbbbbb are in the
CO - App (16)
language but a, abb, ba, and aaabb are not.
b. Draw parse trees for the sentence aabb and aaaabbbb, as derived from the
grammar of the given question.
5. Explain about recursive-descent parsing. CO - U (16)
6. Explain Attribute Grammars with example. CO - U (16)
7. Given the following grammar and the right sentential form, draw a parse tree
and show the phrases and simple phrases, as well as the handle. S →
CO - App (16)
AbB|bAc A → Ab| aBB B → Ac| cBb|c
Acccbbc b. AbcaBccb c. baBcBbbc
8. Consider the following grammar for arithmetic expressions:
E→E+T|T
T→T*F|F
CO - App (16)
F → (E) | id
Find a Leftmost derivation and Rightmost derivation for the expression
id, id + id, id+id*id.
9. Describe the parsing problem for a top-down parser CO - U (16)
10. Describe the parsing problem for a bottom-up parser CO - U (16)
11. What is parsing, what are the difference types of parser available, discuss? CO - U (16)
12. Explain top-down parser with example. CO - U (16)
UNIT - II
1. Define static binding and dynamic binding CO - U (16)
2. Define fully qualified and elliptical references to fields in records. CO - U (16)
3. Explain Arithmetic expression? Explain with example Relational and Boolean CO - U (16)
Expressions.
4. Explain briefly about control Structures. CO - U (16)
5. Define lifetime, scope, static scope, and dynamic scope. CO - U (16)
6. Explain Records data type. CO - U (16)
7. Explain Expression in programming languages CO - U (16)
8. Explain about binding. CO - U (16)
9. Explain with examples for control structures. CO - U (16)
10. What are the different types of binding available, explain with an example? CO - U (16)
11. What is meant by data type? What is the various Primitive Data type? Evaluate CO - U (16)
the various data types
12. Explain Overloaded Operators. CO - U (16)
UNIT - III
1. Explain the types of parameter passing methods. CO - U (16)
2. Write short notes on recursion to compute the factorial function. CO - U (16)
3. Brief the design issues for functions? CO - U (16)
4. Explain about Parameter Passing methods. CO - U (16)
3
5. Consider the following program written in C syntax: CO - App (16)
void swap(int a, int b)
{ int temp;
temp = a;
a = b;
b = temp;
}
void main()
{ int value = 2, list[5] = {1, 3, 5, 7, 9};
swap(value, list[0]);
swap(list[0], list[1]);
swap(value, list[value]);
}
For each of the following parameter-passing methods, what are all of the values
of the variables value and list after each of the three calls to swap?
a. Passed by value
b. Passed by reference
c. Passed by value-result
6. Present one argument against providing both static and dynamic local variables CO - U (16)
in subprograms.
7. Show the stack with all activation record instances, including the dynamic chain, CO - App (16)
when execution reaches position 1 in the following skeletal program. This
program uses the deep-access method to implement dynamic scoping.

void fun1() {
float a;

}

void fun2() {
int b,c;

}

void fun3() {
float d;

}

void main() {
char e, f, g;

}
4
The calling sequence for this program for execution to reach fun3 is
main calls fun2
fun2 calls fun1
fun1 calls fun1
fun1 calls fun3
8. Explain about the types of Dynamic Scoping. CO - U (16)
9. Show the stack with all activation record instances, including static and dynamic CO - App (16)
chains, when execution reaches position 1 in the following skeletal program.
Assume Bigsub is at level 1.
Procedure Bigsub is
Procedure A is
Procedure B is
begin—of B
….l
end;-- of B
procedure Cis
begin — of C

B;

end; -- of C
begin — of A

C;

end; -- of A
begin — of Bigsub

A;

End;--of Bigsub

10. Write short notes on implementing subprograms. CO - U (16)


11. Describe the deep-access method of implementing dynamic scoping. CO - U (16)
12. Explain about Dynamic Scoping. CO - U (16)
UNIT - IV
1. Discuss the design issues of Exception Handling. CO - U (16)
2. Define a Thread. How are threads different from processes with examples. CO - U (16)
3. What is an event? How the events are handled in various OOP languages. CO - U (16)
4. Explain the basic concepts of exception handling. CO - U (16)
5. Write short notes on Monitors. CO - U (16)
6. What is an event? How the events are handled in various OOP languages. CO - U (16)
7. Explain in detail semaphores. CO - U (16)
5
8. Write a program that asks the user for a number and displays ten times the CO - APP (16)
number. Also the program must throw an exception when the user enters a
value greater than 10
9. Explain Methods of Providing Synchronization CO - U (16)
10. Define monitor. Explain how cooperation synchronization and competition CO - U (16)
synchronization are implemented using monitors
11. Write short notes on semapores CO - U (16)
12. Consider the following C++ skeletal program: CO - APP (16)
class Big {
int i;
float f;
void fun1() throw int {
...
try {
...
throw i;
...
throw f;
...
}
catch(float) { . . . }
...
}
}
class Small {
int j;
float g;
void fun2() throw float {
...
try {
...
try {
Big.fun1();
. . . throw j;
. . . throw g;
...
}
catch(int) { . . . }
...
}
catch(float) { . . . }
}
} In each of the four throw statements, where is the exception handled? Note
that fun1 is called from fun2 in class Small.

6
UNIT - V
1. Explain the fundamentals of programming languages CO - U (16)
2. Differentiate functional programming and object oriented programming CO - U (16)
3. Write the factorial function by using ML CO - App (16)
4. Explain about LISP functional programming language CO - U (16)
5. Explain list structures and Goal statements in PROLOG. CO - U (16)
6. Write differences between procedural and non-procedural languages CO - U (16)
7. Discuss about basic elements of prolog. Give examples. CO - U (16)
8. Write a prolog description of your family tree (based only on facts), going back CO - App (16)
to your grandparents and including all descendants. Be sure to include all
relationships.
9. Discuss about basic elements of prolog. Give examples. CO - U (16)
10. Briefly explain application logic programming. CO - U (16)
11. How ML is different from other functional programming languages? CO - U (16)
12. How PROLOG is different from other logic programming languages? Give an CO - U (16)
example for each feature

You might also like