Programming Languages Chapter Exam Questions - 651 Verified Questions

Page 1


Programming Languages

Chapter Exam Questions

Course Introduction

This course offers a comprehensive introduction to the design, implementation, and characteristics of programming languages. Students will explore fundamental programming paradigms such as procedural, object-oriented, functional, and logic programming. The course covers essential language features including syntax, semantics, data types, control structures, abstraction mechanisms, and memory management. Comparative analysis of representative languages, such as Python, Java, C++, and Scheme, highlights the strengths and tradeoffs of different approaches. Emphasis is placed on understanding how languages influence program structure, software development, and problem solving. Practical assignments and projects provide hands-on experience in writing, interpreting, and reasoning about programs in multiple languages.

Recommended Textbook

Programming Languages Principles and Practices 3rd Edition by Kenneth C. Louden

Available Study Resources on Quizplus

13 Chapters

651 Verified Questions

651 Flashcards

Source URL: https://quizplus.com/study-set/1650 Page 2

Chapter 1: Introduction

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32743

Sample Questions

Q1) ____ languages allow the user to enter the requirements for a program and have the system implement the requirements..

A) Imperative

B) Functional

C) Definitive

D) Specification

Answer: D

Q2) A text file is considered to be a ____.

A) basic data abstraction

B) basic control abstraction

C) structured data abstraction

D) structured control abstraction

Answer: C

Q3) An abstraction is a way of expressing ideas that make them concise,simple,and easy for the human mind to grasp.

A)True

B)False

Answer: True

To view all questions and flashcards with answers, click on the resource link above. Page 3

Chapter 2: Language Design Criteria

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32744

Sample Questions

Q1) When applied to data types,value semantics means that assignment produces two references to the same object.

A)True

B)False

Answer: False

Q2) The fact that C does not allow array types to be the return value of a function indicates a lack of ____ in the language.

A) generality

B) uniformity

C) orthogonality

D) efficiency

Answer: C

Q3) Design goals for programming languages have not changed through the years.

A)True

B)False

Answer: False

Q4) Macros can be used to improve the readability of a language.

A)True

B)False

Answer: True

Page 4

To view all questions and flashcards with answers, click on the resource link above.

Chapter 3: Functional Programming

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32745

Sample Questions

Q1) To express symbols as a data type in Scheme,use the keyword ____.

A) symbol

B) form

C) quote

D) exclamation

Answer: C

Q2) The simplest unit of syntax in Scheme is called an atom.

A)True

B)False

Answer: True

Q3) Which of the following represents a list of data in Scheme?

A) (3.1, 3.2, 3.3)

B) (3.1; 3.2; 3.3)

C) (quote (3.1 3.2 3.3))

D) (quote (3.1, 3.2, 3.3))

Answer: C

Q4) Haskell supports a type class inheritance through a hierarchy of type classes.

A)True

B)False

Answer: True

To view all questions and flashcards with answers, click on the resource link above. Page 5

Chapter 4: Logic Programming

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32746

Sample Questions

Q1) Most Prolog systems are run as interpreters,not compilers.

A)True

B)False

Q2) In Prolog,the cut operator is used to ____.

A) stop a search of a tree

B) move a node from one tree to another

C) remove a node from a tree

D) prune duplicates from a tree

Q3) Variables set equal to patterns are said to be ____.

A) unified

B) instantiated

C) initialized

D) resolved

Q4) Prolog applies resolution in a strictly linear fashion,replacing goals from left to right.

A)True

B)False

Q5) Prolog completely satisfies the original goal of logic programming.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 6

Chapter 5: Object-Oriented Programming

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32747

Sample Questions

Q1) In C++,instance variables and methods are both called descriptors.

A)True

B)False

Q2) C++ permits an object to be allocated either directly on the stack or as a pointer.

A)True

B)False

Q3) In Java,scalar data types are also called ____ types.

A) primitive

B) simple

C) quantitative

D) flexible

Q4) A(n)____ message is sent to a class in Smalltalk.

A) object

B) class

C) control

D) constructor

Q5) C++ has built-in garbage collection.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 7

Chapter 6: Syntax

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32748

Sample Questions

Q1) Derivation is the process that replaces left-hand sides by choices of right-hand sides appearing in prior rules.

A)True

B)False

Q2) White space is an example of a token delimiter.

A)True

B)False

Q3) The process of associating the semantics of a construct to its syntactic structure is called syntax-directed semantics.

A)True

B)False

Q4) The description of simple integer arithmetic expressions with addition and multiplication cannot be represented by a context-free grammar.

A)True

B)False

Q5) A bottom-up parser constructs derivations and parse trees from the leaves to the root.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 8

Chapter 7: Basic Semantics

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32749

Sample Questions

Q1) A(n)____ occurs when the same object is bound to two different names at the same time.

A) conflict

B) alias

C) multi-reference

D) duplicate

Q2) The body of an externally defined function will not be bound until ____.

A) execution time

B) link time

C) translation time

D) load time

Q3) Each function call generates a region of allocated memory associated with the function; this is called an activation record.

A)True

B)False

Q4) The lifetime of an object is the duration of its allocation in the environment.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 9

Chapter 8: Data Types

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32750

Sample Questions

Q1) Type ____ algorithms determine if two separately declared types are the same.

A) inference

B) equivalence

C) comparison

D) enforcing

Q2) Polymorphism allows names to have multiple types but does not allow for static type checking.

A)True

B)False

Q3) Pointers are often used in the creation of recursive types.

A)True

B)False

Q4) Hindley-Milner type checking assigns type variables to all unnamed types.

A)True

B)False

Q5) The type system is the naming convention for data types.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 10

Chapter 9: Control I - Expressions and Statements

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32751

Sample Questions

Q1) Exception handling is an attempt to imitate in a programming language the features of a hardware interrupt or error trap.

A)True

B)False

Q2) If an exception is thrown and no handler is found in the block,control is passed to the next enclosing block in a process that is called ____ the exception.

A) transferring

B) redirecting

C) propagating

D) throwing

Q3) Lisp requires all expressions to be fully parenthesized.

A)True

B)False

Q4) Arguments are specified for use with ____.

A) functions

B) unary operators

C) expressions

D) binary operators

To view all questions and flashcards with answers, click on the resource link above. Page 11

Chapter 10: Control II - Procedures and Environments

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32752

Sample Questions

Q1) The group of actions in a procedure is called the ____ of the procedure.

A) parameters

B) arguments

C) activation record

D) body

Q2) The access link provides access to ____.

A) local variables

B) nonlocal variables

C) parameters

D) imported variables

Q3) Pass ____ copies in the parameter value,and at the end of execution,copies out the final value of the parameter.

A) by value

B) by reference

C) by value-result

D) by address

Q4) Pass by name can be described as an advanced inlining process for procedures.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 12

Chapter 11: Abstract Data Types and Modules

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32753

Sample Questions

Q1) The namespace-like mechanism in Java is the ____.

A) module

B) namespace

C) import

D) package

Q2) An operation that creates a new object of the data type being defined is called a(n)____.

A) constructor

B) initializer

C) generator

D) invoker

Q3) A set and operations that meet the algebraic specification of an abstract data type are a(n)____ for the specification.

A) example

B) model

C) prototype

D) abstract

Q4) Information hiding refers to the separation of data from the programmer.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 13

Chapter 12: Formal Semantics

Available Study Resources on Quizplus for this Chatper

50 Verified Questions

50 Flashcards

Source URL: https://quizplus.com/quiz/32754

Sample Questions

Q1) The Law of ____ states that nothing a programming construct can do will make false into true.

A) Monotonicity

B) Conjunction

C) Disjunction

D) the Excluded Miracle

Q2) The Law of ____ states that if a postcondition Q implies R then the weakest precondition of Q implies the weakest precondition of R.

A) the Excluded Miracle

B) Conjunction

C) Monotonicity

D) Disjunction

Q3) Operational semantics cannot be used to define program behavior in terms of an abstract machine.

A)True

B)False

Q4) Semantic domains having additional mathematical structure are called algebras.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 14

Chapter 13: Parallel Programming

Available Study Resources on Quizplus for this Chatper

51 Verified Questions

51 Flashcards

Source URL: https://quizplus.com/quiz/32755

Sample Questions

Q1) Another name for the bounded buffer problem is the producer-consumer problem.

A)True

B)False

Q2) An example of the ____ model is where a process creates several child processes,each with its own code,and then waits for the children to complete their execution.

A) fork-join

B) SIMD

C) MIMD

D) distributed memory

Q3) Program-level parallelism provides fine-grained control over processes.

A)True

B)False

Q4) It is not possible to have a system in which each processor has some private memory in addition to shared memory.

A)True

B)False

Q5) Distributed-memory systems can still be shared-memory systems.

A)True

B)False

15

To view all questions and flashcards with answers, click on the resource link above.

Turn static files into dynamic content formats.

CreateΒ aΒ flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.