Choose The Most Appropriate Answer
Choose The Most Appropriate Answer
Choose The Most Appropriate Answer
SECTION “A”
[20 Q 0.5 = 10]
Choose the most appropriate answer.
1. Orthogonality, syntax design, support of abstraction and exception handling are related with
__________ .
[ ] Readability [ ] Writability [ ] Reliability [ ] All given options
3. Which of the following statements about the current standard Java implementation for Java is
not true?
[ ] It contains a compiler (javac) that translates Java source code to Java bytecode.
[ ] It implements Java using a pure compiler.
[ ] The virtual machine for executing Java bytecode (java) uses a bytecode interpreter.
[ ] The virtual machine for executing Java bytecode (java) uses a just-in-time compiler.
10. Consider the following operation. What will be the resultant data type0000?
(float)a * (int)b / (long)c * (double)d
[ ] int [ ] long [ ] float [ ] double
12. Whenever a new value is placed in a memory location, that value overrides the previous
value in that location. This process is said to be
[ ] destructive [ ] constructive [ ] nondestructive [ ] value overriding
13. Artificial Intelligence is a broad area of computer application characterized by the use of
rather than computation.
[ ] function, symbol [ ] symbol, numeric [ ] numeric, function [ ] numeric, symbol
16. An attribute grammar is a device used to describe more of the structure of a programming
language than can be describe with a .
[ ] Recursively enumerable [ ] Context-sensitive
[ ] Context-free [ ] Regular
1. Provide your strong arguments on the idea of “single language for all programming domain”?
Many languages treat identifiers of uppercase letters and lowercase letters differently. What
are the pros and cons of this design decision?
2. Prove that the following grammar is ambiguous:
S A
A A + A | <id>
<id> a | b | c
3. Covert the given FSA into regular expression
Design a state diagram to recognize one form of the comment of the C-based programming
languages, those that begin with /* and end with */.
6. What do you mean by pairwise disjoint test? Explain with suitable example. What is
difference between l-value and r-value of a variable?
7. How is stack dynamic variable different from heap dynamic variable? What do you mean by
coroutine? Where is it mainly used?
SECTION “C”
[2 Q. 8 = 16 marks]
Attempt any TWO questions:
8. Consider the following grammar and parse table. Show a complete parse, including the parse
stack contents, input string, and action for the string (id+id)+id.
Grammar:
1. E E+T
2. E T
3. T T*F
4. T F
5. F (E)
6. F id
void main( ){
int i = 10, j = 10, sum1, sum2;
sum1 = (i/2) + fun (&i);
sum2 = fun(&j) + (j/2);
}
a) What will be the values of sum1 and sum2 if
i. operands in the expressions are evaluated left to right?
ii. operands in the expression are evaluated right to left?
b) Define the side effect of a function? What is coercion? Define narrowing and widening
conversions. What is short-circuit evaluation?
10. Explain in detail about parameter passing methods for sub-programs. Consider the following
program written in C:
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 the values of a variable value
after each call to swap function?
a. Pass by Value
b. Pass by Reference
c. Pass by Value-Result
Objective Answers
1. Reliability
2. A-0, A-1, and A-3
3. It implements Java using a pure compiler.
4. compiled code will usually run faster.
5. context-free grammars
6. corresponds to reverse of right derivation of grammar
7. <expr> ::= <term> {+ <term>}
8. binding
9. Finite state automaton
10. double
11. b
12. destructive
13. symbol, numeric
14. short code
15. Meta Language
16. Context-free
17. COBOL
18. outin mode
19. descriptor
20. compatibility