CSCI 312: Final Exam

Ace your homework & exams now with Quizwiz!

Which of the following is not a scripting language?

C++

How do Functional Programming languages handle I/O?

Input and output operations change the state a program and therefore cannot be part of any pure functional programming language.

Which of these is true about inheritance

It enhances the potential re-use of existing software

The reason for studying concepts of programming languages are

It helps a programmer to learn several other languages.

APL is a programming language that provides

Many powerful operators

a scattering assignment

acos(4.4)

An object exists in LambdaMOO:

after you call the `create()' function

The LambdaMOO server command parser breaks apart commands of the form:

all of the above

Integers and floating-point numbers in LambdaMOO:

cannot be mixed because LambdaMOO does not automatically coerce integers into floating-point numbers

The expression 13 + (x = 17) in the LambdaMOO language:

changes the value of `x' to be 17 and returns 30

Which function checks whether or not the quota is positive before reducing it by one and storing it back into the ownership_quota property on the owner?

create()

The following conditional expression in LambdaMOO expression-1 ? expression-2 | expression-3 is evaluated as

if expression-1 is true, return expression-2 otherwise return expression-3

Given these lines of LambdaMOO code cnt = 1; for obj in [#0..max_object()] cnt = cnt + 1; if (cnt % 100 == 0) player:tell(obj); endif endfor What will the first two lines of printed output look like?

#98 #198

The three special object numbers used for a variety of purposes: #-1, #-2, and #-3, are usually referred to as:

$nothing, $ambiguous_match, and $failed_match object, verb and property

What is an example of short circuit evaluation?

(19 * a ) * ( b + 14 c ) when the value of a is 0

What does the following expression in Scheme evaluate to (- 5 (* 6 3))?

-13

How many characters could a variable name in FORTRAN I have?

6

What is a higher order function?

A function that can take one or more functions as parameters or returns a function as a result, or both.

Which factor/s contributes towards increasing cost of a programming language?

A language having expensive implementation system and not portable

What is a Functional Programming Language?

A language that is designed to mimic mathematical functions to the greatest extent possible

In what common data structure are LISP lists normally stored?

A linked list structure in which each node has two pointers.

What does a lambda expression specify?

A nameless function that performs some behavior.

Dijkstra s guarded command is primarily meant for what purpose?

A new programming methodology that supports correctness during development.

Which of the following is not a Boolean operator?

ADD

Exception handling is

Ability of a program to intercept run-time errors, take corrective measures and continue

The ancient precursors to MUDs were:

Adventure and Zork

The most common data structures in the field of scientific applications of programming languages was

Arrays and matrices

What data type(s) were parts of the original LISP?

Atoms and lists

A language that is writable but not reliable because of its flexibility in pointer usage is

C++

Name the first programming language whose use was mandated by the Department of Defense.

COBOL

The first successful high level language for business was

COBOL

How does listset(newlist, "blah", 2) affect the list newlist = {"first", "second", "third"}?

Change the second element to "blah"

Arithmetic operators consist of the following factors except for?

Char

All functional programing languages are?

Compiled and/or interpreted varies with the languages.

Which of the following is not a design choice for C s switch statement?

Control expression cannot be integer type.

SIMULA 67 works with coroutines. What is a coroutine?

Controls allowing subprograms to restart at the position where they previously stopped.

PL/I represents the first large scale attempt to design a language that could be used for a broad spectrum of application areas. Which of the following was a contribution of PL/I ?

Detect and handle 23 different types of exceptions or run-time errors.

Which of the following was NOT incorporated in the design goals of BASIC

Difficult and meant only for science students to learn and use

What was the type of scoping used in the original LISP?

Dynamic

What is the difference between EQV? And EQ? In Scheme?

EQV? tests for the equality of two atoms without knowing whether they are symbolic or numeric whereas EQ? compares the pointer values.

What function is available in Scheme that can be called to interpret Scheme code?

EVAL

Speedcoding was an interpretive system developed by John Backus for which of the following?

IBM 701

Which of the following is true about Orthogonality?

Every possible combination of primitives is legal and meaningful

The highest precedence in Ruby is given to which operator?

Exponentiation

What is an example of a narrowing conversion?

Float to int

Which of the following is not an example of selection statement?

For loop

The cockroach of programing languages is:

Fortran

Which version of FORTRAN added support for object oriented programming?

Fortran 2003

Which version of FORTRAN included If with an optional Else clause?

Fortran 77

Garbage Collection supported by Java is a process which

Frees the programmer from needing to delete objects explicitly when they are no longer needed.

What is a control structure?

It is a control statement and a collection of statements whose execution it controls.

What does a selection statement do?

It provides the means of choosing between two or more paths of execution.

The largest impact of Pascal was

It was used to teach programming from 1971-1990s in colleges and universities.

What is true about Java programs

Its designers traded execution efficiency for reliability

Which language does not include a goto statement?

Java

Which of the following is considered a functional programming language?

LISP

In which form of loop is the repetition control based on a Boolean expression rather than a counter?

Logically controlled loops.

Machine code was replaced by Assembly language because.

Machine code was tedious and error prone

Use of an operator for more than one purpose is called?

Operator overloading

Lists in Lisp are specified using:

Parentheses

In the compilation process, which of the following represent the syntactic structure of the program

Parse trees

The highest precedence in C based languages is given to which operator?

Postfix ++

Aliasing means

Presence of two or more distinct referencing methods for the same memory location

What is the von Neumann bottleneck about

Program instructions often can be executed much faster than the speed of the connection

Which of these is a functional programming language and has only two data types: atoms and lists?

Pure Lisp

Which of the following is not true regarding the original Scheme programming language mentioned in the Text Book?

Scheme like LISP before it uses dynamic scoping.

When would you prefer pure interpretation of programs

Small programs where efficiency can be neglected

Name the first programming language that fully supported Object Oriented Programming.

Smalltalk

One common feature of APL and SNOBOL is

Storage is allocated to a variable when it is assigned a value i.e. dynamic storage allocation.

The evolution of programming design methodology is as follows

Structured programming ->Data oriented programming -> Object oriented programming

Which of the following assignment statements increments count and then assigns the value to sum?

Sum = ++count

JSP is a Mark-up programming hybrid language used to

Support dynamic Web documents and provide other processing needs of Web documents.

C#, JavaScript, Ruby and Python all provide support for this particular feature found in Functional Programming Languages:

Support for nameless functions

Which new feature was incorporated in ALGOL 60 that was not available in ALGOL 58?

The concept of block structure was introduced.

Referential transparency refers to what?

The execution of a function always produces the same result when give the same parameters.

Which of these is true of the Von-Neumann architecture?

The execution of machine code occurs in a process called the fetch-execute cycle

If a function is called tail recursive then?

The last statement within the function is a recursive call to the function itself.

E_PERM will be raised if

The programmer does not meet some specified criteria allowing read or write permission

A ternary operator has how many operands?

Three

ALGOL 60 was the result of efforts...

To design a universal programming language for scientific applications.

What is true about mark-up languages?

They are also called programming hybrid languages

Which of the following properties are similar for Java and C++?

They both have classes and primitive types.

Which of the following is not a characteristic of Purely Functional Programming Language?

They do not always produce the same results when executing the same function with the same parameters

The error value E_VERBNF stands for:

Verb not found

Which method transfers execution control to a specified place in the program?

Unconditional branching.

Ruby uses which method call to replace the FOR statement?

Upto

Data-oriented program design methodology focuses on

Use of abstract data types

BREAK is an example of which type of looping implementation in Java?

User located loop control mechanism

When would you use a functional programming language over an imperative one?

When the nature of the underlying problem being solved is an underlying mathematical one.

When can a program have referential transparency?

When two expressions in the program having same value can be substituted for one another anywhere in the program, without affecting the action of the program.

An example of a markup language would be

XSLT

An assignment expression that looks like this: {target, ...} = expr is called a:

a scattering assignment

Almost every command is parsed by the LambdaMOO server into a call on:

a verb

The Apply-to-All Functional Form is achieved in Scheme by using the following keyword:

map

State the correct algorithm for the fetch-execute cycle

repeat forever Fetch the instruction pointed by the counter Increment the counter Decode the instruction Execute the instruction end repeat

The two major components in the LambdaMOO system are:

server and database

To stop listening at port 7800, we would use

unlisten(7800)

The x (execute) bit on a LambdaMOO verb determines

whether or not the verb can be invoked from within a MOO program (as opposed to from the command line)

Assume that the variable 'a' has the value {2, 3, 4} and that 'b' has the value {'Foo', 'Bar'}. The 'splicing' operator is '@'. What is the result of the expression: {1, @a, 5}:

{1, 2, 3, 4, 5}

The result of setadd({1, 2}, 2) is:

{1, 2}


Related study sets

Chapter 22 Introduction to the Cardiovascular System

View Set

when to reject or fail to reject null hypothesis

View Set

Chapter 5 Practice Quiz- Part three (Principles of Management)

View Set

Chapter 6 Electricity and Magnetism

View Set

Washington Laws and Rules Pertinent to Insurance

View Set

تاريخ الفصل الرابع 💜

View Set