Vous êtes sur la page 1sur 3

I.

Multiple Choice (30%)

1. In what language is most of UNIX written?


a. C
b. C++
c. C#
d. Java

2. Which one of the following is NOT a phases of Compilation process?


a. Lexical analysis
b. Exception handling
c. Syntax and Semantic analysis
d. Code generation

3. There are three primary methods of semantics description, except:


a. Operation
b. Axiomatic
c. Aritmatic
d. Denotational

4. Difficulty of using pointer and reference variables correctly, the cost of references to the
variables, and the complexity of the required storage management implementation is
disadvantage of:
a. Stack dynamic variables
b. Explicit heap dynamic variables
c. Impilicit heap dynamic variables
d. Static variables

5. Run time overhead of maintaining all the dynamic attributes is the disadvantage of:
a. Stack dynamic variables
b. Explicit heap dynamic variables
c. Impilicit heap dynamic variables
d. Static variables

6. Closures, which combine a subroutine pointer and a referencing environment,


a. Are needed only for language with static (not dynamic) scope
b. Are needed only for first-class (not second – or third class) subroutines
c. Are needed only for deep (not shallow) binding
d. All of the above

7. Below are primitive data type, except


a. Floating Point b. Boolean c. Complex d. Vector

8. Variable that has memory address value is


a. Heap b. Address c. Pointer d. Cell
9. Unordered collection of data elements that are indexed by an equal number of values called
keys is
a. Union b. Asscociative Array c. List d. enum

10. An operator that has three operands named by …


a. Binary Operator c. Prefix Operator
b. Infix operator d. Ternary Operator

11. Type conversions are either narrowing or widening. Which one is widening type conversion…
a. double to float c. int to float
b. int to char d. float to int

12. Show the order of evaluation of the following expression by parenthesizing all sub expression a *
b–1+c
a. ((a * b) – 1 ) + c c. a * (b – (1 + c))
b. a * ((b – 1) + c) d. (a * (b – 1)) + c

13. The switch statement in C or Java Programming language is an example of


a. One way selection
b. Two way selection
c. Multipe way selection
d. Uncoditional branch

14. The body of a loop is always executed at least once in the case of
a. Counter controlled loop
b. Pretest logically controlled llop
c. Posttest logically controlled loop
d. All loop cases

15. Programming language designs are also influenced by the trend in software development
methodologies. The latest methodology is known as
a. Structured programming
b. Procedure oriented programming
c. Data oriented programming
d. Object oriented programming
II. Essay (70%)

1. (10%) To evaluate features and capabilities of various progrraming langauges, we need a set of
evaluation criteria. Describe those criteria.

2. (15%) A grammar is given as follows:


<assign> → <id> = <expr>
<id> → a | b | c
<expr> → <id> + <expr>
| <id> * <expr>
| ( <expr> )
| <id>
Show that statement a = a * (b * (c + a)) can be generated by the grammar using left
derivation.

3. (15%) Bindings can be viewed as association between attributes and variable. Explain different
kinds of such bindings with examples.

4. (15%) A local variable can be a static variable or a stack dynamic variable. Explain the
advantanges and disadvantages of static and dynamic variables.

5. (15%) Describe different types of selection statements and iterative statements, and give
examples.

Vous aimerez peut-être aussi