Quiz
CS 3360 Programming Languages Quiz Questions
Este quiz tem tipos de pergunta que abrem no player de sempre.
Perguntas do quiz (67)
1The Study of programming languages is valuable for a number of important reasons, Including:
- AIt increases our capacity to use different constructs in writing programs
- BIt enables us to choose languages for projects more intelligently
- CIt makes learning new languages easier
- DAll of the above
2Which of the following is an incorrect association between a programming language and its application area?
- AFortran = Scientific applications
- BCobol = Business
- CLisp = AI
- DC = Systems Programming
- EJava = Scripting
3There are many different criteria for evaluation programming languages, including readability, writability, reliability and overall cost. Among these, the most important criteria for judging a programming language [blank_start]readability[blank_end].
- Areadability
4Which of the following is not a major factor that determines the readability of a programming language?
- AOverall simplicity
- BOrthogonality
- CControl Statements
- DData types and structures
- EType checking
5A language is said to be [blank_start]orthogonal[blank_end] if it has a relatively small set of primitive constructs that can be combined in a relatively small number of ways to build the control and data structures of the language.
- Aorthogonal
6The major influences on a language design have been [blank_start]machine architecture[blank_end] and software design methodologies.
- Amachine architecture
7Programming languages can be categorized into different paradigms or families, such as imperative, functional, logic, and object-oriented. In an [blank_start]imperative[blank_end] language, an algorithm is specified in great detail and the specific order of execution of the instructions or statements must be included.
- Aimperative
8The three fundamental features of an object-oriented programming language are all of the following except for:
- AData abstraction
- BInheritance
- CException handling
- DDynamic method binding
9Designing a programming language is primarily an engineering feat, in which a long list of tradeoffs must be made among features, constructs, and capabilities. Example trade-offs include:
- AReliability vs. execution cost
- BReadability vs writability
- CFlexibility vs. safety
- DAll of the above
10.The major methods of implementing programming languages are [blank_start]compilation[blank_end], pure interpretation, and hybrid implementation.
- Acompilation
11There are two formal ways for defining the syntax of a programming language: a language recognizer and a language [blank_start]generator[blank_end].
- Agenerator
12There are two formal ways for defining the syntax of a programming language. The Backus- Naur Form (BNF) is an example of a language [blank_start]generator[blank_end] and can define a class of languages called context-free languages.
- Agenerator
13In BNF, you define a language by writing a set of definitions called rules or [blank_start]productions[blank_end], each of which describes the structure of a language construct, e.g., an assignment statement.
- Aproductions
14Which of the following is NOT a current statement about a derivation?
- AA derivation is a repeated application of rules, starting with the start symbol and ending with a sentence
- BEvery string of symbols in a derivation is a sentential form
- CA sentence is a sentential form that has only terminal symbol
- DA leftmost derivation is one in which the leftmost nonterminal I each sentential form is the one that is expanded
- EA derivation is either leftmost or rightmost derivation
15A [blank_start]Parse Tree[blank_end] is a hierarchical representation of a derivation. It can tell how a language processor like a compiler recognizes a sentence.
- AParse Tree
16A grammar is said to be [blank_start]ambiguous[blank_end] if it can generate a sentential form that has two or more distinct parse trees
- Aambiguous
17The grammar containing a rule: expr -> expr + expr, where expr is a non-terminal, is ambiguous
- AVerdadeiro
- BFalso
18In BNF, you can express operator precedence. The technique is to introduce separate nonterminal symbols to represent the operands of operators and to let the grammar force the operators to different levels in a parse tree.
- AVerdadeiro
- BFalso
19A grammar rules is left [blank_start]recursive[blank_end] if its left-hand side appears at the beginning of its right-hand side. Such a rule specifies left associativity of an operator.
- Arecursive
20Which of the following is an incorrect statement about the extended BNF (EBNF)?
- ABNF has been extended in several ways to provide short-hand notations called EBNF
- BEBNF enhances the descriptive or expressive power of BNF in that it can express a language that cannot be expressed in BNF
- CThe most common extensions of EBNF include: optional parts, repetitions, and alternatives
21An [blank_start]attribute grammar[blank_end] is a formal device to describe more of the structure of a programming language than can be described with a context-free grammar, e.g., static semantics. It is an extension to a context-free grammar
- Aattribute grammar
22The static semantics of a programming language is only indirectly related to the meaning of programs during execution; it has to do with the legal forms program, e.g., type constraints.
- AVerdadeiro
- BFalso
23Which of the following is NOT true?
- AAn example of a syntax rule that cannot be specified in BNF is a rule stating all variables must be declared before they are referenced
- BAn attribute grammar is an addition to BNF to allow certain language rules to be conveniently described
- CThe primary value of an attribute grammar is to specify the static semantic rules of a programming language
- DThe expressive power of BNF and attribute grammars are the same
24The key idea of attribute grammars is to associate a set of constraints with grammar rules and allow the rules to be expandable during derivations only when their associated constraints are satisfied.
- AVerdadeiro
- BFalso
25An attribute grammar is a BNF with three additions: attributes, attribute computation functions, and [blank_start]predicate functions[blank_end].
- Apredicate functions
26The role of an attribute is to carry some semantic information for a grammar symbol (terminal or nonterminal), and an attribute companion function, also called semantic function, is to specify how an attribute value is computed. A [blank_start]predicate function[blank_end] states the semantic rules or constraints of a grammar rule.
- Apredicate function
27There are three types of attributes including all of the following EXCEPT for:
- AIntrinsic attributes
- BSynthesized attributes
- CInherited attributes
- DHybrid attributes
28The process of computing the attribute values of a parse tree is sometimes called decorating the parse tree. It can be done in a completely top-down order, a bottom-up order, or a combination of both
- AVerdadeiro
- BFalso
29By default, PHP documents end with the extension [blank_start]php[blank_end]. When a file with this extension is requested, a web server passes the requested file to a PHP processor
- Aphp
30There are several different tags to embed PHP code in an HTML document, and the most common and recommended tag is “<?php” with its ending marker “?>”.
- AVerdadeiro
- BFalso
31PHP supports both C++ style single line comment “//” and the C style multi-line comment “/*…*/”
- AVerdadeiro
- BFalso
32In PHP, all variable names must start with a [blank_start]$[blank_end] character.
- A$
33PHP supports all of the following values (or data types) EXCEPT for:
- ABooleans
- BIntegers
- CFloating-point numbers
- DStrings
- EArrays
- FRecords
34Which of the following statements are incorrect about PHP strings?
- AA string can be expressed by enclosing it in a pair of single or double quotes, e.g., ‘hello’ or “hello”
- BThere is no semantic difference between the use of single and double quotes expressing a string
- CA special character can be contained in a string by preceding it with an escape character
- DTwo strings can be concatenated using the dot (.) operator
35PHP is a strongly typed language in that all variables must be declared with their types before they are used, and PHP will never convert variables to the type required by their context when they are accessed
- AVerdadeiro
- BFalso
36There can be different PHP variables mainly depending on their scopes and lifetimes, including all of the following EXCEPT for:
- AMicro variables
- BLocal variables
- CGlobal variables
- DStatic variables
- ESupergobal variables
37A [blank_start]local[blank_end] variable is a variable that is created within, and can be accessed only by a function. It is generally a temporary variable that is used to store a partially processed result prior to the functions return.
- Alocal
38When a variable is created within a function, its value is wiped out when the function ends. If a function runs many times, it starts with a fresh copy of the variable and the previous setting has no effect. If you’d like to keep its value for the next time the function is called and to prevent any other parts of your code from accessing it, you can declare it a [blank_start]static[blank_end] variable.
- Astatic
39A program [blank_start]variable[blank_end] is an abstraction in a programming language for the memory location in a von Neumann architecture
- Avariable
40A variable is characterized by such attributes as:
- AName
- BAddress
- CValue
- DType
- ELifetime
- FScope
- GAll of the above
41There are two types of special words in programming languages to separate the syntactic parts of statements and programs. A keyword is a special word that is special only in certain contexts. A [blank_start]reserved word[blank_end] is a special word that cannot be used as a name; it is special in all contexts.
- Areserved word
42The address of a variable (l-value) is the machine memory address with which it is associated. Which of the following is an incorrect statement of the address of a variable?
- AA variable may have different addresses at different times during execution.
- BThe same name may have different addresses at different places in a program.
- CIf two variable names can be used to access the same memory location, they are called aliases.
- DAliases are harmful to program efficiency.
43A type determines the range of values that a variable can have and the set of operations that are defined for values of that type.
- AVerdadeiro
- BFalso
44A binding is an association, such as between an attribute and an entity or between an operation and a symbol. A binding time is a time at which a binding takes place, and their several possibilities including:
- ALanguage design time
- BLanguage implementation time
- CCompile time
- DLoad and linking time
- ERuntime
- FAll of the above
45A binding is [blank_start]static[blank_end] if it first occurs before run time and remains unchanged throughout program execution.
- Astatic
46The [blank_start]lifetime[blank_end] of a variable is the time during which it is bound to a particular memory call.
- Alifetime
47 Which storage binding scheme is described below? Storage binding is created for variables when their declaration statements are elaborated. It allows recursion and conserves storage, however, it incurs the overhead of allocation and deallocation and doesn’t support history sensitive variables for subprograms. [blank_start]________[blank_end]
- AStatic-dynamic
48The [blank_start]scope[blank_end] of a variable is the range of statements over which it is visible.
- Ascope
49A data type defines a collection of data values and a set of predefined operations on those values.
- AVerdadeiro
- BFalso
50A (variable) [blank_start]descriptor[blank_end] is the collection of the attributes of a variable. If the attributes are all static, it is required only at compile time. For dynamic attributes, however, part or all of it must be maintained during execution.
- Adescriptor
51A data type that is not defined in terms of other types is called a [blank_start]primitive[blank_end] data type. Examples include numeric types such as integer, floating-point, complex, and decimal.
- Aprimitive
52There are several design choices regarding the length of string values and java uses:
- AStatic length
- BLimited dynamic length
- CDynamic length
53An [blank_start]enumeration[blank_end] type is one in which all of the possible values, which are named constants, are provided, in the definition.
- Aenumeration
54Some of the design issues for enumeration types are:
- AIs an enumeration constant allowed to appear in more than one type definition, and if so, how is the type of an occurrence of that constant in the program checked?
- BAre enumeration values coerced to integer?
- CAre any other types coerced to an enumeration type?
- DAll of the above
55There are five categories of arrays, based on the binding to subscript ranges, the bindings to a storage, and from where the storage is allocated. The category names indicate the design choice of the three, and they include all of the following EXCEPT for:
- AStatic array
- BStatic-dynamic array
- CFixed stack-dynamic array
- DStack-dynamic array
- EFixed heap-dynamic array
- FHeap-dynamic array
56There are two ways in which multi-dimensional arrays can be mapped to one dimension. In [blank_start]row major order[blank_end], the elements of the array that have as their first subscript the lower bound value of that subscript are stored first, followed by the elements of the second value of the first subscript, and so forth. If the array is a matrix, it is stored by rows.
- Arow major order
57A [blank_start]record[blank_end] is an aggregate of data elements in which the individual elements are identified by names and accessed through offsets from the beginning of the structure.
- Arecord
58The two main problems of pointers are [blank_start]dangling pointers[blank_end] and lost heap-dynamic variables
- Adangling pointers
59A language that is object oriented must provide support for three key language features. Which of the following is NOT one of the three key features?
- AAbstract data type
- BInheritance
- CDynamic binding
- DComposition
60 When a method is overridden in a subclass, the runtime system can determine, during execution, which method should be called, i.e., the overridden or the overriding one. This is called [blank_start]dynamic binding[blank_end].
- Adynamic binding
61A number of issues must be considered when designing the features of an object-oriented programing languages, including:
- AExclusivity of objects
- BSubclass vs subtypes
- CSingle vs multiple inheritance
- DObject allocation and deallocation
- EDynamic vs static binding
- FNesting of classes
- GInitialization of objects
- HAll of the above
62All of the followings are general characteristics of C++, EXCEPT for:
- AHas a mixe typing system
- BSupport for both constructors and destructors
- CProvide elaborate access controls to class entities
- DSupport only single inheritance, not multiple inheritance
63In C++, subclassing and subtyping are different, that is, you can introduce a subclass without making it a subtype
- AVerdadeiro
- BFalso
64In C++, all member functions (methods) are statistically bound unless they
are declared virtual- AVerdadeiro
- BFalso
65All of the following are general characteristics of java, EXCEPT for:
- AAll data are objects except for the primitive types
- BAll primitive types have a wrapper classes that store one data value
- CAll objects are heap-dynamic and are referenced through reference variables
- DMultiple inheritance is supported
66In java, all (non-static) methods are dynamically bound unless they are declared final or private
- AVerdadeiro
- BFalso
67Two key implementation data structures to support dynamic binding of method calls to methods are a class instance record (CIR) and a [blank_start]virtual method table[blank_end].
- Avirtual method table
Informações
- Descrição
- Computer Science Quiz sobre CS 3360 Programming Languages Quiz Questions, criado por Stephanie Medina em 24-10-2018.
- Autor
- Stephanie Medina
- Idioma
- English
- Visualizações
- 20
- Etiquetas
- Avaliação
- Ainda sem avaliações Avalie este quiz