Question

1. (p. 2-3.) Which of the following is NOT a reason for studying concepts of programming...

1. (p. 2-3.) Which of the following is NOT a reason for studying concepts of programming languages according to Sebesta?

a. Increased capacity to express ideas.

b. Improved background for choosing appropriate languages.

c. Increased ability to design new languages.

d. Increased ability to learn new languages.

2. (p. 5-6.) What programming language has dominated scientific computing over the past 50 years?

a. FORTRAN

b. ALGOL

c. SNOBOL

d. PL/I

3. (p. 6.) What programming language has dominated artificial intelligence over the past 50 years?

a. Prolog

b. Scheme

c. C

d. LISP

4. (p. 7) What meaning does Sebesta give to the language evaluation criterion readability?

a. The programming language presents no challenges to be read by a machine.

b. A program that is easily read is one in which programs are easily maintained.

c. The programming language has constructs that supported all areas of application.

d. The programming language has unique operators for each type and subtype.

5. (p 36)The first programmer was a. Ada Lovelace b. Konrad Zuse c. Grace Hopper d. John von Neumann

6. (p. 10 – 12) Select the best definition of orthogonality in the context of programming language criteria.

a. Orthogonality means that each operator is precisely defined for a set of valid operand types.

b. Orthogonality means that each operator is defined for all operand types.

c. Orthogonality means that each operator coerces the types of invalid operands to valid types.

d. Othogonality means that each operator is valid only for a single type.

7. (p. 11) What language used orthogonality as a primary design criterion?

a. ALGOL 68.

b. VAX assembly language

c. LISP

d. Modula-2

8. (p. 8) Which of the following is not a programming language evaluation criteria according to Sebesta?

a. syntax design

b. expressivity

c. restricted aliasing

d. type design

9. (p. 7) In what language is UNIX written?

a. B

b. C

c. C++

d. Java

10. (p. 19) What has been the strongest influence on programming language design over the past 50 years?

a. imperative programming methodology

b. the von Neumann architecture

c. BNF specification of programming language

d. the exponential growth of memory

11. (p. 22) Which language was first to support the three fundamental features of objectoriented programming?

a. Smalltalk

b. CLOS

c. SIMULA-67

d. C++

12. (p. 22) Which of the following is not a fundamental feature of an object-oriented programming language?

a. data abstraction b. inheritance

c. dynamic method binding

d. interface encapsulation

13. (p. 121-122) Given the grammar in the figure below, select the leftmost derivation of the string a+b*c. e → t e → e+t e → e-t t → f t → t*f t → t/f t → t%f f → (e) f → id Figure13.

a. Step Sentential Form 1 e 2 e+t 3 e+t*f 4 t+f*id(c) 5 f+id(b)*id(c) 6 id(a)*id(b)+Id(c)

b. Step Sentential Form 1 e 2 e+t 3 e+t*f 4 t+f*id(c) 5 t+id(b)*id(c) 6 f+id(b)*id(c) 7 id(a)+id(b)*id(c)

c. Step Sentential Form 1 e 2 e+t 3 e+t*f 4 t+t*f 5 f+t*f 6 id(a)+t*f 7 id(a)+f*f 8 id(a)+id(b)*f 9 id(a)+id(b)*id(c)

d. Step Sentential Form 1 e 2 e+t 3 t+t 4 f+t 5 id(a)+t 6 id(a)+t*f 7 id(a)+f*f 8 id(a)+id(b)*f 9 id(a)+id(b)*id(c)

14. (p 120) The first language to employ BNF was

a. Pascal

b. LISP

c. FORTRAN

d. Algol60

15. (Ch. 3. Lecture Notes) Given the grammar in the figure below, select the rightmost derivation of the string a+b*c. e → t e → e+t e → e-t t → f t → t*f t → t/f t → t%f f → (e) f → id Figure 15.

a. Step Sentential Form 1 e 2 e+t 3 e+t*f 4 t+f*id(c) 5 f+id(b)*id(c) 6 id(a)*id(b)+id(c) 5

b. Step Sentential Form 1 e 2 e+t 3 t+t 4 f+t 5 id(a)+t 6 id(a)+t*f 7 id(a)+f*f 8 id(a)+id(b)*f 9 id(a)+id(b)*id(c)

c. Step Sentential Form 1 e 2 e+t 3 e+t*f 4 t+t*f 5 f+t*f 6 id(a)+t*f 7 id(a)+f*f 8 id(a)+id(b)*f 9 id(a)+id(b)*id(c)

d. Step Sentential Form 1 e 2 e+t 3 e+t*f 4 e+t*id(c) 5 e+f*id(c) 6 e+id(b)*id(c) 7 t+id(b)*id(c) 8 f+id(b)*id(c) 9 id(a)+id(b)*id(c) 6

16. (Project p01 notes) What sequence of tokens is recognized by the regular expressions shown in the figure below given the input string +123.1?

[+|-]?[0-9]+\.[0-9]*([E|e][+|-]?[0- 9]+)? [+|-]?[0-9]+ \.[0-9]+ “.” [+|-] [0-9]+ Figure 16.

a. 3 tokens as follows + 123 .1

b. 1 token as follows +123.1

c. 4 tokens as follows + 123 . 1

d. 2 tokens as follows +123 .1

17. (p. 27) Which of the following is NOT a phase of compilation? a. lexical analysis b. semantic analysis c. syntax analysis d. static analysis 18. (p. 125 - 128) Which selection correctly orders the precedence of operators in the grammar in the figure below? Operators are ordered from left to right, highest to lowest. e → t e → e+t e → e-t t → f t → t*f t → t/f t → t%f f → (e) f → id Figure18.

a. () * / % + -

b. + * - / % ()

c. () * + / - %

d. + - * / % () 7

19. (p. 124 - 125) Which of the following grammars is NOT ambiguous?

a. E->E+E E->E*E E->(E) E->id

b. E->E+T | T T->T*F | F F->(E) | id

c. E->E A E | (E) | id A -> + | *

d. E->E+E | E*E | (E) | id

20. (p. 123 - 124) Select the parse tree for the sentence B * ( A + C ) in the grammar shown below.

a. e → t e → e*t t → f t → t+f f → (e) f → ID e t t f e e t f t t f * + ( ) ID(B) ID(A) ID(C) Figure 20a

b. e e * t t f f ( e ) ID(B) t t + f f ID(C) ID(A) Figure 20b

c. e e + t t f f ( e ) ID(B) t t * f f ID(C) ID(A) Figure 20c

d. e t t f e e t f t t f + * ( ) ID(B) ID(A) ID(C) Figure 20d

21. (p. 129 - 130) Select the table that correctly specifies the precedence and associativity of the operators given in the grammar shown below. Please note that the highest precedence is one (1). e → t e → e+t e → e-t t → f t → t*f t → t/f f → p f → p ^ f p → (e) p → u u → -u u → id Figure 21.

a.op name precedence associativity - unary minus 1 right () parenthesis 2 n/a ^ exponentiation 3 right * multiplication 4 left / division 4 left + addition 5 left - subtraction 5 left Table 21.

b. op name precedence associativity + addition 1 left - subtraction 1 left * multiplication 2 left / division 2 left ^ exponentiation 3 right () parenthesis 4 n/a - unary minus 5 right Table 21.

c. op name precedence associativity - unary minus 1 left () parenthesis 2 n/a ^ exponentiation 3 left * multiplication 4 right / division 4 right + addition 5 right - subtraction 5 right Table 21.

d. op name precedence associativity + addition 1 right - subtraction 1 right * multiplication 2 right / division 2 right ^ exponentiation 3 left () parenthesis 4 n/a - unary minus 5 left Table 21.

25. (p. 191 - 194) Which of the following is a limitation of the LL grammar class?

a. must be implemented by employing a recursive descent parser

b. left recursion must be eliminated

c. lexical analysis must be implemented using finite automata

d. must be implemented using a pushdown automaton

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please comment below, If you find any difficulty in understanding

Please Upvote, If you are impressed with the answer

Q #1

Answer : c (Increased ability to design new languages)

Q #2

Answer : a (FORTRAN - is a programming language which dominated scientific computing over 50 years)

Q #3

Answer : d (LISP - is a functional language which dominated Artificial Intelligence over 50 years)

Q #4

Answer : b ( A program that is easily read is one in which programs are easily maintained.)

Q #5

Answer : a ( Ada Lovelace - the first computer programmer)

Q #6

Answer : b (Orthogonality means that each operator is defined for all operand types.)

Q #7

Answer : c ( LISP - is a functional language)

Q #8

Answer : d (type design)

Q #9

Answer : b (C language)

Q #10

Answer : b (the von Neumann architecture )

Q #11

Answer : a (Smalltalk )

Q #12

Answer : a (data abstraction )

Q #13

Answer : d (Step Sentential Form 1 e 2 e+t 3 t+t 4 f+t 5 id(a)+t 6 id(a)+t*f 7 id(a)+f*f 8 id(a)+id(b)*f 9 id(a)+id(b)*id(c) )

Q #14

Answer : d (Algol60)

Q #15

Answer : c.

Q #16

Answer : a (3 tokens as follows + 123 .1)

Q #17

Answer : d (static analysis )

Q #18

Answer : a ( () * / % + - )

Q #25

Answer : b (left recursion must be eliminated )

Add a comment
Know the answer?
Add Answer to:
1. (p. 2-3.) Which of the following is NOT a reason for studying concepts of programming...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT