When an exception occurs in an ada procedure either in the


1. A vector processor is an example of a ______ computer.

a. single instruction, single data stream (SISD)

b. multiple instruction, multiple data stream (MIMD)

c. single instruction, multiple data stream (SIMD)

d. multiple instruction, single data stream (MISD)

2. Prolog's order of evaluation is:

a. left to right, depth first.

b. right to left, depth first.

c. left to right, breadth first.

d. right to left, breadth first.

3. A data structure consisting of an integer variable and a queue of task descriptors is called a semaphore.

a. True

b. False

4. In Prolog, instantiation:

a. binds a value to a variable.

b. binds a type to a variable.

c. computes an inferred proposition from given propositions.

d. a and b.

e. a and c.

f. b and c.

g. all of the above.

5. A monitor:

1. shared data is resident in the monitor rather than clients.

2. provides synchronization without semaphores.

3. provides cooperation synchronization.

a. 1 and 2

b. 1 and 3

c. 2 and 3

d. 1, 2, and 3

6. In C++, exceptions are raised by the _____ expression.

a. raise

b. try

c. when

d. throw

7. All of the following are advantages of exception handling except:

a. eliminates code clutter resulting from error-checking.

b. enables error propagation to specialized routines.

c. provides the means for avoiding logic errors.

d. encourages programmers to consider all of the events that could occur and plan for handling them.

8. In the event a Java Virtual Machine runs out of heap memory, an exception is thrown by the Error class that should be handled by the programmer.

a. True

b. False

9. Programs that have coroutines have _____ of control.

a. a single thread

b. multiple threads

c. virtual multiple threads

d. physical multiple threads

10. In Ada, the block or unit that raises an exception is continued or resumed.

a. True

b. False

11. The simplest choice for handling an exception is:

a. continue execution at the next block of code.

b. continue execution at the next statement.

c. terminate the program.

d. none of the above.

12. When an exception occurs in an Ada procedure, either in the elaboration of its declaration or execution of its body, the exception:

1. is implicitly propagated to the calling program unit at the point of the procedure call.

2. may be traced back through its static ancestors, at the programmer's option.

3. may be traced back through its dynamic ancestors, at the programmer's option.

a. 1

b. 2

c. 3

d. 1 and 2

e. 1 and 3

f. 2 and 3

g. All of the above.

13. In logic programming, the right side of a _______ form proposition is called the _______.

a. sentential; consequent

b. clausal; consequent

c. sentential; antecedent

d. clausal; antecedent

14. If a computer has more than one processor, several program units from the same program may execute simultaneously. This type of concurrency is termed:

a. virtual.

b. literal.

c. physical.

d. logical.

15. Using Scheme, LET creates a new local dynamic scope in much the same way as Ada's declare.

a. True

b. False

16. A binary semaphore is a semaphore that has a queue of binary variables.

a. True

b. False

17. In logic programming, the inference rule that allows inferred propositions to be computed from given propositions is called:

a. unification.

b. resolution.

c. instantiation.

d. evaluation.

18. Scheme predicate functions return a Boolean value of either True or

False.

a. True

b. False

19. Consider the following Scheme function:

(DEFINE (mystery lis1 lis2)

(COND

((NULL? lis1) (NULL? lis2))
((NULL? lis2) ‘())
((EQ? CAR lis1) (CAR lis2))
(mystery (CDR lis1) (CDR lis2)))
(ELSE ‘())
))

The third COND case is:

a. recursive.

b. iterative.

c. a function itself.

d. none of the above.

20. The mystery function in the above question:

a. sorts a list.

b. sorts the second list in the same order as the first.

c. reverses two lists.

d. compares two lists for equality.

21. Programming languages based on symbolic logic are called:

a. imperative.

b. functional.

c. declarative.

d. mathematical.

22. The developers of LISP identified and included specifications for

dynamic scoping.

a. True

b. False

23. Using Scheme, (EQ? ‘(A B) ‘(A B)) returns:

a. #T

b. #F

c. ( )

d. a or b

e. a or c

f. b or c

24. Propositions in a logic programming language can be stated in two distinct modes:

a. one to define a proposition as true and one in which the truth of the proposition is yet to be determined.

b. one to define a proposition as true and one to define a proposition as false.

c. one to define a proposition as true or false, and one in which the truth of the proposition is yet to be determined.

d. none of the above.

25. In Prolog, the right-hand side of a statement is analogous to the "then" part of an "if..then" statement in an imperative language.

a. True

b. False

Solution Preview :

Prepared by a verified Expert
JAVA Programming: When an exception occurs in an ada procedure either in the
Reference No:- TGS01251065

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)