Study Questions for CS 381

These are intended for your self study only. If you can answer these questions, then you are in pretty good shape. If you can't answer them, then you need to study some more.

Lecture 1

  1. List three reasons why it is important to study programming languages.
  2. What are four main programming paradigms?
  3. Why is the readability of programs an important concern?
  4. How is readability of a programming language different from its writability
  5. What are some of the costs involved in using a new programming language?

Lecture 2

  1. Why did the programming language Plankalkul have so little impact on subsequent programming languages designs?
  2. What was the importance of the Fortran programming language in the 1950's?
  3. What does the name Lisp stand for?
  4. In what problem area was Lisp intended to be used?
  5. What is the name of the first programming language designed by an international committee and independent of any single computer company?
  6. In what ways was the language in the previous question successful? In what ways was it a failure?
  7. What problem domain was the language COBOL designed for?
  8. Where was the programming language BASIC developed? What were the objectives of its designers?
  9. What is the importance of the language Simula?
  10. Who designed the language Pascal? What was its original purpose?
  11. In what company was the language C developed? For what purpose was this language designed?
  12. What new programming paradigm was introduced by the programming language Prolog?
  13. What programming paradigm is exemplified by the programming language Smalltalk?
  14. Who designed the programming language C++?
  15. What concomitant development assisted the popularization of the programming language Java?

Fill in the following table:
LanguageWhenWhoWhereWhy Important
Plankulkul
Fortran
Lisp
Algol
Cobol
Pl/1
Basic
Pascal
C
C++
Java

Lecture 4

  1. In what ways is the design of a function language different from the design of a language based on the von Neumann architecture?
  2. How does the use of identifier names differ in a functional language versus an imperative language?
  3. What is referential transparency?
  4. What is a lambda expression?
  5. What is a higher order function? (also called a functional).
  6. if F(x) is x + 3 and G(x) is x * x, and H(x) is the composition of G and F, what is H(2)?
  7. What is the multiplication reduction of the list (1 2 3 4) when the identity is 1? What about when the identity is zero?

Lecture 5

  1. What are the two major categories of objects in Lisp?
  2. What is the car of a list? What is the cdr?
  3. What is the data interpretation of a list? What is the functional interpretation?
  4. What is a predicate?
  5. Can you show how to convert any if expression into a cond expression?

Lecture 6

  1. Can you explain the use and purpose of each of the following functionals?
  2. What is the fundamental data type manipulated by APL programs?
  3. What are some features that distinguish ML and Haskell programs from Lisp programs?
  4. How can ML programs be strongly typed if they do not have (many) declaration statements?
  5. What are some advantages of imparative programs over functional programs? What are some advantages of functional programs over imparative programs?

Lecture 7

  1. What is the difference between syntax and semantics?
  2. What is a sentence? What is a token?
  3. What do the letters BNF stand for?
  4. What is a metalanguage?
  5. What is a grammar?
  6. What does it mean to say a grammar is ambiguous?
  7. Can you show how to encode precedence and associtivity of operators in a grammar?

Lecture 8

  1. What are the three most common ways of defining formal semantics?
  2. How are semantics normally defined informally?
  3. How do you create an operational semantic definition of a language?
  4. What is axiomatic semantics?
  5. What is a precondtion? What is a postcondition?

Lecture 9

  1. When speaking of names, what is a connector?
  2. What is the difference between a reserved work and a keyword?
  3. What are some advantages of having names case sensative? What are some disadvantages?
  4. What is the difference between a variable address and a variable value?
  5. What is an alais?
  6. What is a binding? What are some possible binding times?
  7. What is a static binding? What is a dynamic binding?
  8. What does it mean to say that a language uses static type binding? What about dynamic type binding?

Lecture 10

  1. What is the difference between type compatability that is determined by structure and that determined by name?
  2. What compatability rules are normally used for arrays?
  3. What compatability rules are normally used for records (or classes)?
  4. What is a variable scope?
  5. What does it mean to say that a language uses lexical scope?
  6. What does it mean to say that a language uses dynamic scope?

Lecture 11

  1. Why do we have types in programming languages?
  2. What is a primitive data type?
  3. Why do we say that floating point values only approximate the real numbers?
  4. What is the advatage of using a decimal data type instead of a float? What is the disadvantage?
  5. Why are boolean types often represented using more than one bit?
  6. What are problems introduced by the view that a string is just an array of characters?
  7. What is an enumeration type? What advantage does a language gain by having such values?
  8. What is a subrange type?

Lecture 12

  1. What features force an array to be stack-dynamic or heap-dynamic?
  2. What is an array slice?
  3. What is the calculation used to access an element in a two-dimenstional array if stored in row-major order? How does this change if the array is stored in column major order?
  4. What is an associative array?
  5. In what way is an associative array similar to an array? In what way is it different?

Lecture 13

  1. What are the characterstics of a set?
  2. What are the two major implementation techniques for a set?
  3. What restrictions are imposed by the bitset representation?
  4. What is a pointer?
  5. What problems can arise from the incorrect use of pointers?

Lecture 15

  1. What is the earliest and simplest type of control flow statement?
  2. Why have later languages tended to de-emphasize or even remove this statement?
  3. What limitation of the IF statement in fortran was removed by the introduction of compound statements in ALGOL-60?
  4. What is the dangling else problem? What are some ways that it has been solved?
  5. In what ways is a case (or switch) statement similar to an IF? In what ways is it different?

Lecture 16

  1. What type of sequence is typically generated by a FOR statement?
  2. What are the arguments for binding the limit and step of a for statement at the time the statement begins execution? What are some arguments for binding these values on each iteration?
  3. How does the C for statement generalize the earlier Pascal and Algol versions?
  4. How is the Pascal Repeat ... until statement different from the C do ... while statement?

Lecture 19

  1. What are the three different statement types in Prolog?
  2. What does it mean to say that Prolog is a declarative language?
  3. What is backtracking? Why is backtracking necessary in a prolog execution?