Unformatted text preview:

CSCI 431 Programming Languages Exam 2: Fall 1998Name:_____________________________CSCI 431 Programming Languages Exam 2: Fall 1998Name:_____________________________True/False Questions (each question is worth 2 points)1. True or False, you can write exception handlers for the built-in exceptions in Ada.2. True or False, in Smalltalk all expressions evaluate to messages.3. True or False, in Smalltalk there are no reference variables.4. True or False, in Smalltalk objects are stored on the run-time stack.5. True or False, Java supports templates?6. True or False, in Java and C++ the compiler generates a default constructor if the class definition does not provide one.7. True or False, Java is a pure OO language.8. True or False, in Java all objects are stored on the heap.9. True or False, in C++ all objects are stored on the heap.10. True or False, when the Ada select statement is used with multiple accept clauses, it is non-deterministic.11. True or False, in Ada all tasks terminate when their code is completed and their master has terminated.12. True or False, Java supports physical concurrency.13. True or False, the empty set is an example of a regular language.14. True or False, non-deterministic finite automata can recognize a larger class of languages than deterministic finite automata.15. True or False, in C++, by default, messages are statically bound to methods but the default can be overridden.16. True or False, in Ada,, when a task receives a message at an entry point it must process that message immediately.17. True or False, in Ada, each task may have only one entry point.Short Answer Questions (each question is worth 3 points)18. Below is the specification and body of an Ada package:Specification: generictype Element_Type is private; procedure Swap(Left, Right : in out Element_Type);Body: procedure Swap(Left, Right : in out Element_Type) is Temporary : Element_Type; begin Temporary := Left; Left := Right; Right := Temporary; end Swap;What is Element_Type in this package?19. If an exception is raised (or thrown) and no exception handler is defined what will happen?20. Name one of the built-in exceptions in Ada and describe at least one condition that would raise this exception.21. Name one of the first Object Orientated Languages to be developed.22. Write a short definition of each of the following terms:a. a derived class (also called a subclass)b. methods c. messages23. The following are Smalltalk messages. In each case, identify the object receiving the message.a. ‘Hello World’ printNl !b. 2+3 !c. [sum _ sum + index] value !24. Name an OO language that supports multiple inheritance.25. What is a template function in C++?26. An abstract class in C++ is comparable to what in Java.27. What is the purpose of the keyword virtual in C++?28. What is an MIMD machine?29. What is a SIMD machine?30. Define the following terms:a. mutual exclusion b. synchronizationc. critical region31. Name three approaches to implementing mutual exclusion.32. Name three languages that support concurrent programming?33. In Ada,, what is a rendezvous?34. When discussing formal language theory, what are the definitions of the following terms:a. a stringb. a grammarc. a non-terminal symbol34. When the Kleene star operator is applied to the set of strings A={a, c} what is the output? 35. What are the 4 types of grammars in the Chomsky hierarchy?36. What is the minimum machine capable of recognizing a regular language?37. Below is an example of a grammar. With respect to the Chomsky hierarchy, what kind of grammar is this? G = ({a, b}, {S, A, B}, S, R), where R = { S -> e, S -> aB, S -> bA, A -> a, A -> bA, B -> b, B -> bS, B -> aB}38. Specify an automata to recognize {01*0}39. Specify an automata to recognize any string composed of 0’s and 1’s that has an odd number of


View Full Document

UNCA CSCI 431 - Examination

Download Examination
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Examination and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Examination 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?