1. Which of the following is not an OO programming language?

    A. Java
    B. C++
    C. Smalltalk
    D. Simula 67
    E. None of the above.


  2. Which of the following language is not a declarative language?

    A. Java
    B. Prolog
    C. SQL
    D. Scheme
    E. None of the above.


  3. Which of the following is a script language?

    A. Java
    B. C#
    C. PHP
    D. Prolog
    E. Scheme
    F. None of the above.


  4. BNF was first used to describe the syntax of which language:

    A. C
    B. Fortran
    C. Algol
    D. COBOL
    E. LISP
    F. None of the above


  5. Which of the following is not part of a compiler?

    A. Scanner;
    B. Parser;
    C. Code generator;
    D. Optimizer;
    E. Interpreter;
    F. None of the above.


  6. When you run the following Java program:
    public class Hello {
    public static void main(String [] a){
     System.out.println("Hello");
    }
    }
    
    How many classes will be loaded into the system?


    A. One
    B. Two
    C. Three
    D. Dozens
    E. Hundreds
    F. None of the above


  7. A program written in an interpreted language is usually

    A. slow to run;
    B. slow to develop;
    C. slow to compile;
    D. None of the above.


  8. Compared with declarative languages, which of the following is not true for imperative languages:

    A. Can have side effects;
    B. More efficient to run;
    C. Closer to computer;
    D. Hard to implement;
    E. None of the above.


  9. What is the value of (map (lambda (x) (* 2 x)) (1 2 3)) ?

    A. a run-time error
    B. ( ) (the empty list)
    C. (3 4 5)
    D. (2 4 6)
    E. 12
    F. none of the above


  10. What is the value of (map (lambda (x) (* 2 x)) '(1 2 3)) ?

    A. a run-time error
    B. ( ) (the empty list)
    C. (3 4 5)
    D. (2 4 6)
    E. 12
    F. none of the above


  11. What is the value of (eval (map (lambda (x) (* 2 x)) '(1 2 3)))?

    A. a run-time error
    B. ( ) (the empty list)
    C. (3 4 5)
    D. (2 4 6)
    E. 12
    F. none of above