This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CSci 5106: Programming Languages Problem Set for Final Exam Included below are a few problems that should give you an idea of the kinds of questions you might encounter in the final exam for CSci 5106. In the actual exam, there would be six or seven questions. These questions can cover any topic seen in the course but would be weighted towards testing your understanding of things discussed since the mid-term, i.e., those things in this course that you have not been tested on already in an exam setting. The sample questions below are of varied levels of difficulty. You must be comfortable with all these kinds of questions in order to be prepared for the exam. A reminder that the exam is open book but only the book may be open; in particular, no additional notes, electronic devices, etc will be permitted. Problem I. We have seen three different programming paradigms in some detail in this course. Your job in this question is to compare and contrast these paradigms and languages. Your answer should have at least the following components: 1. It should explain the different views of computation taken in the three paradigms. 2. It should discuss the characteristic tools offered by each paradigm for programming and their suitability to particular programming tasks. 3. It should explain the differences in design choices in Pascal and C and discuss their pros and cons. 4. It should discuss similarities and differences in the realization of particular features in languages across the functional programming/imperative programming boundary. Consider especially the issues of types and data representation. Be brief and to the point. The grade will be based on the relevance of the points you make, the thinking manifest in the comments and the extent of coverage. Problem II. Provide a single program fragment that produces different results under each of the following parameter passing mechanisms: 1. Call-by-value 2. Call-by-reference 3. Call-by-name Explain also the manner in which this fragment manifests the differences. Think carefully about what is essential before you write down this fragment. Your answer will be graded for conciseness and clarity in addition to correctly distinguishing between the different mechanisms. 1 Problem III. 1. Distinguish between concrete syntax, parse trees and abstract syntax. Use an example to bring out the differences. 2. Present an abstract syntax representation for the following program in a Pascal-like language; assume that cons and tail are functions the programmer has defined else- where. s := s0; r := nil; while s <> nil do begin r := cons(head(s),r); s := tail(s); end Explain the representation that you use for each of the constructs you need to treat....
View Full Document
This document was uploaded on 05/06/2011.
- Fall '09