1111 - SP2010 Midterm Exam CSCI524 Principles of Programming Languages Prof E Chen University of Northern Virginia 1/13 1 Which statement is true

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
SP2010 Midterm Exam CSCI524 –Principles of Programming Languages Prof. E. Chen University of Northern Virginia 1/13 1. Which statement is true regarding the Language Evaluation Criteria of Simplicity and Orthogonality? a) Simplicity is same as Orthogonality. b) Simplicity includes Orthogonality. c) Orthogonality includes Simplicity. d) None of above is true. 2. Which statement is true regarding the Language Evaluation Criteria of Simplicity and Multiplicity? a) Simplicity means “having only one way to accomplish a particular operation. b) Multiplicity means “having more than one way to accomplish a particular operation. c) Multiplicity includes Simplicity. d) None of above is true. 3. What is the lowest syntactic unit in programming language? a) Token. b) Lexeme. c) Variables. d) Parse Tree. 4. Which construct does not meet the concept of Orthogonality? a) User-defined data types b) Dynamic arrays SP2010 Midterm Exam CSCI524 –Principles of Programming Languages Prof. E. Chen University of Northern Virginia 2/13 c) Floating-point d) None of above 5. Which statement is true regarding Smalltalk? a) It is a compling system b) The program units are objects c) It is an Object-Oriented programming language d) All of above Use this Grammar to complete the following questions An Unambiguous Grammar for Simple Assignment Statements <assign> ) <id> := <expr> <id> n A | B | C <expr> n <expr> + <term> | <term> | <expr> - <term> <term> n <term> * <factor> | <factor>
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
<factor> n ( <expr> ) | <id> Return the answer in a different paper, scan or picture them, and send back with the answers. 6. B := (A + B ) * (B – C) SP2010 Midterm Exam CSCI524 –Principles of Programming Languages Prof. E. Chen University of Northern Virginia 3/13 7. C := A – B * C + A * (B + C) 8. A := A * (C – A + B) * (A – B) 9. B := B – C * A + B 10. C := (B – C * A) * (B – C) 11. According to the following grammar, please select a true statement. A Grammar for Simple Assignment Statements <assign> ) <id> := <expr> <id> n A | B | C <expr> n <expr> + <term> | <term> | <expr> - <term> <term> n <term> * <expr> | ( <factor> ) | <id> a) This grammar does not give the precedence over the multiplication operator and parenthese operator. b) This grammar will only generate one parse tree c) This grammar does not give the precedence over the multiplication operator and addition/subtraction operator. d) None of above. SP2010 Midterm Exam CSCI524 –Principles of Programming Languages Prof. E. Chen University of Northern Virginia 4/13 12. Which statement is true regarding to an ambiguity grammar? a) It will always generate more than one parse tree in an ambiguity grammar.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/10/2011 for the course CSCI 500 taught by Professor Assdullah during the Spring '11 term at Northern Virginia.

Page1 / 8

1111 - SP2010 Midterm Exam CSCI524 Principles of Programming Languages Prof E Chen University of Northern Virginia 1/13 1 Which statement is true

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online