CMPS 350 HW 02: History of Languages (ch 2) & Functional Languages (ch 15)

Click 'check' on each question or your score will not be recorded.

01. What is true about Fortran?
    A. It was designed specifically for the VAX 3000. 
    B. Designer John Backus was first and foremost a hardware designer.
    C. Backus claimed Fortran would virtually eliminate coding errors.
    D. Backus later retracted his earlier claim regarding coding errors.
A B C D
02. Which feature(s) were not in Fortran 0?
    A. assignment statements
    B. subroutines 
    C. loop control statements
    D. string data types 
A B C D
03. How did index registers, which first appeared in the IBM 701 in 1955,
    influence the evolution of programming languages? 
    A. by eliminating the need for absolute addressing into arrays 
    B. by allowing loop operations on arrays to be implemented more efficiently 
    C. both A and B 
A B C
04. The first Fortran compiler was developed in which decade?  
    A. 1940       B. 1950         C. 1960      D. 1970
A B C D
05. Which constructs were in the original specification of LISP?
    A. atoms    B. lists    C. arrays    D. numbers
A B C D
06. The primary reason for the relative slowness of pseudocode interpreters in 
    the early 1950s was what? 
    A. floating-point arithmetic done in software rather than hardware
    B. insufficient memory
    C. both A and B
A B C
07. The writer and designer of Fortran (John Backus) was also the co-designer 
    of which of the following?
    A. the IBM computer architecture that the Fortran compiler ran on 
    B. the LISP programminhg language
    C. the VAX minicomputer architecture 
A B C
08. What behaviors differentiate dynamic typed languages from non-dynamic ones?
    A. the value of a variable may change at runtime
    B. the address of a global variable may change at runtime
    C. the type of a variable may change at runtime 
    D. the size of a global variable may change at runtime 
A B C D
09. The "psuedocode" languages prior to Fortran were designed to overcome which 
    hardware deficiencies?
    A. multiple CPUs 
    B. index registers
    C. floating-point support 
    D. pipelining
A B C D
10. In an imperative language, the primary operation is
    A. the if statement  
    B. the assignment statement  
    C. the loop   
    D. all three 
A B C D
11. The LISP language was written in what decade?  
    A. 1940       B. 1950         C. 1960       D. 1970
A B C D
12. Which statements are true regarding the COBOL language?
    A. COBOL was developed by computer manufacturers and the Dept. of Defense.
    B. A 1997 Gartner Group report found 80% of the world's business apps ran 
       on COBOL.
    C. All subsequent imperative languages are based on COBOL.
    D. COBOL was the first language to separate code and data in memory. 
A B C D
13. What missing language element of ALGOL 60 damaged its chances for 
    widespread use? 
    A. dynamic memory 
    B. input/output statements
    C. pass by reference 
A B C
14. The first COBOL compiler was released in what decade?
    A. 1940     B. 1950      C. 1960    D. 1970     
A B C D
15. Which language provided the basis of all subsequent imperative languages,
    although the language itself was never widely used?
    A. PL/I     B. ALGOL     C. Ada    D.  SIMULA 
A B C D
16. Select the true statements. BASIC  
    A. was the first widely used time-sharing language.
    B. was originally designed for non-science students.
    C. was first implemented on an Intel microprocessor.
    D. is a functional language. 
A B C D
17. Why was BASIC an important language in the early 1980s?
    A. BASIC was the first structured programming language.
    B. Microcomputers had small memories and BASIC interpreters were very small.
    C. both statements are true  
A B C
18. PL/I was designed to replace which language?
    A. Fortran     B. COBOL       C. ALGOL      D. all three
A B C D
19. PL/I was designed for what type of computer?
    A. mainframe   B. minicomputer   C. microcomputer  D. embedded system 
A B C D
20. Classes and inheritance, now important parts of object-oriented languages, 
    were initially introduced in which language?
    A. LISP      B. SNOBOL       C. Prolog       D. Simula 67  
A B C D
21. What innovation of data structuring was introduced in ALGOL 68 but is often 
    credited to Pascal?
    A. user defined data types     B. dynamic memory    C. arrays
A B C
22. Which design criteria were used extensively in ALGOL 68?
    A. reliability   B. orthogonality   C. concurrency    D. objects
A B C D
23. Which language is considered to be too large and complex?
    A. Ada     B. PL/I     C. LISP    D. ALGOL  
A B C D
24. Algorithms are written as a series of statements (rules and facts) that 
    evaluate to true or false in which language paradigm? 
    A. functional     B. logic    C. declarative    D. both B & D   
A B C D
25. Which language was designed to facilitate string processing?
    A. LISP     B. Algol     C. Prolog     D. SNOBOL  
A B C D
26. When Ada was designed what feature set it apart from other languages?
    A. concurrancy    B. data-oriented   C. procedure-oriented  
A B C
27. Smalltalk, developed by Alan Kay et al. at Xerox, is a precurser for which
    language paradigm?
    A. functional   B. object-oriented   C. procedural   D. declarative
A B C D
28. Which language(s) were forced on programmers by the Department of Defense?
    A. Ada              B. COBOL                C. both A and B 
A B C
29. What Ada construct is similar to classes in the object-oriented paradigm?
    A. packages     B. procedures
A B
30. Delphi is derived from which language?
    A. Ada      B. Pascal     C. Fortran     D. C 
A B C D
31. Which language was developed specifically for web programming?
    A. PHP      B. Python      C. Ruby     D. Perl  
A B C D
32. Perl was written by Larry Wall at JPL to combine or extend which languages?
    A. Unix shell utilities (awk, sed, sh) 
    B. Fortran 
    C. C 
    D. assembly
A B C D
33. The code below will execute without an error in Javascript. Per this 
    example what can you conclude about Javascript? (see code)

    var x = 5;      
    var y = "hi";  
    var z = x + y;  // Line 3  - produces "hi4.5"
    y = 2.5;
    z = y + 7;     // produces 9.5
 
    A. Javascript is a typeless language.
    B. Javascript is a dynamically typed language.
    C. Var x is coerced temporarily into a string at Line 3. 
    D. Javascript overloads the '+' operator. 
A B C D
34. Which of the following is a true statement?
    A. Functions may exist outside classes in both C++ and Java.
    B. Functions may exist outside classes in C++ but not in Java.  
A B
35. What is true regarding C#? 
    A. C# is a compiled language like C++.
    B. C# is a hybrid language like Java and compiled into bytecode first.
A B
36. Which of the following features are in C++ but not in Java?
    A. the goto statement 
    B. pass by reference
    C. both A and B 
A B C
37. Ada was primarily designed for what application area?
    A. engineering    B. business    C. number crunching   D. embedded systems 
A B C D
38. What characteristic of Java is most evident in JavaScript?
    A. how classes are created and used
    B. the syntax of control statements
    C. dynamic typing
A B C
39. Which of the following were goals in the design of C++?
    A. reliability 
    B. to support legacy C programs
    C. to allow an organization similar to Simula 67
    D. generic programming 
A B C D
40. JavaServlets are part of what technology? 
    A. JavaScript    B. JSP     C. .NET     D. XSLT  
A B C D
41. Which statement is true in LISP?
    A. In prefix notation, an operator can take any number of arguments.  
    B. In LISP, everything but NIL and 0 is true.
    C. Both statements are true.      
A B C
42. Why were imperative features added to LISP? 
    A. To reduce function calls and make LISP more efficient.
    B. To improve writeability and readability.
    C. Both A and B
A B C
43. Which of the following is an imperative construct that was added to LISP?
    A. car          B. setf      C. cons        D. lambda  
A B C D
44. Common LISP is a typeless language.
    A. True      B. False
T F
45. In a static scoped language like C, what will function g return?
        x = 0;
        int f() { return x; }
        int g() { int x = 1; return f(); }

     A. 0       B. 1       C. f()  
A B C
46. What will this LISP function return if you call it with (foo '(1 2 3))?

      (defun foo (x)
        (if (null x)
           0 
        (+ (foo (cdr x)) (car x))))

    A. return 3             B. return 6   
A B
47. What does this LISP function return if you call it with (thing '(a b c))?

    (defun thing (x)
       (if (NULL x)
           NIL
           (if (listp (car x) )
               T
               (thing (cdr x)))))
  A.  NIL 
  B.  T
A B
48. This function will return T if the last element in the list y is equal to
    the value of x, otherwise NIL. 
       (defun stuff (x y)
          (if (null y)
              nil
             (if (eql (car y) x)
                 t
                 (stuff x (cdr y)))))
    A. True    B. False  
T F
49. In a LISP interpreter what will this lambda expression return?
           ((lambda (x) (+ x 100)) 1)

    A. 1       B. 101      C. nothing, x has not been assigned a value 
A B C
50. LISP functions return an atom or a list. T is an atom and () is both.
    A. True    B. False 
T F

  Right: Wrong: Percent: (Must be 100% for credit)

Errors:

Name (first name only): Sleipnir Username: 3-digit ID: