WorksheetsBSCS 3-3 : Principles of Programming Languages - Quiz # 1
Total questions: 29
Worksheet time: 17mins
One of the characteristics that makes a good programming language is by having a clear, simple and unity on it, which means?
Program structure reflects the logical structure of algorithm
Being able to combine various language features systematically in which every combination of features is meaningful
Simple readable program is easy to write and easy to decipher once it needs modification
Transportability of the resulting programs from the computer on which they are developed to other computer systems
This refers to the rules that specify the correct combined sequence of symbols that can be used to form a correct structured program using a given programming language
Syntax
Tokens
Semantic
Lexemes
This refers to the character strings assembled from the character stream of a program, which correspond to specific grammatical elements of that language
Syntax
Tokens
Semantic
Lexemes
These are the building blocks of a program’s grammatical structure, representing such basic elements as identifiers, numeric_literals, and specific keywords and operators of the language
Syntax
Tokens
Semantic
Lexemes
Which of the following statement is not true about lexemes?
Lexemes of a programming language includes numeric literals, operators, and special words, among others.
Lexemes are partitioned into groups, for example the names of variables, methods, classes, and so forth in a programming language form a group called identifiers
Each lexeme group is represented by a name, or token
None of the mentioned
Which characteristics of a good programming language describes the relationship between different features in a way that they have minimal effect on each other when they are combined?
Ease of Program Verification
Naturalness
Orthogonality
Portability
This refers as one of the classes of programming environments in which the processing of data are per group.
Batch processing environment
Inter Active Environment
Embedded System Environment
Programming Environment
In principles of programming languages, this concept is the process of associating attributes with names, specifying the exact nature of an attribute, that for each entity, attribute information is contained in a repository
Binding
Naming Variables
Constant
Lifetime
A programming paradigm that emphasizes the computation of values by the use of expressions and building blocks of the program.
Imperative Languages
Functional Languages
Object Oriented Languages
Concurrent Languages
This type of binding is done at the time or during program execution.
Binding Time
Static Binding
Dynamic Binding
Early Binding
A time at which the source code is converted into an executable or machine code. Address binding that is done before loading the program into memory.
Binding Time
Execution Time
Implementation Time
Translation Time
Backus-Naur Form (BNF) is the most widely used method for describing programming syntax under what?
Syntax Analyzer
Formal Language Theory
Context Free Grammar
Regular Expression
In creating production rule using BNF, this part is where any set of combinations of terminals which usually presented by capital letters or inside of "< >".
Terminals
Non-Terminals
Recursive Case
Base Case
The entity which generate Language is termed as:
Grammar
Data
Tokens
Regular Language
Consider the grammar given below E? E+E | E*E | E-E | E/E | E^E | (E) | id Assume that + and ^ have the same but least precedence, and / have the next higher precedence but the same precedence and finally ^ has the highest precedence. Assume + and ^ associate to the left like and / and that ^ associates to the right. Choose the correct for the ordered pairs (^,^), (-,-), (+,+), (*,*) in the operator precedence table constructed for the grammar
All <
All >
< >, =
< > > >
Grammar that produce more than one Parse tree for same sentence is _______
Complementation
Precedence
Ambiguous
Unambiguous
Which of the following is example of Lexemes?
Identifiers
Constants
Keywords
All of the mentioned
The syntax analyzer takes the lexical units from the lexical analyzer and uses them to construct hierarchical structures, representing the syntactic structure of the program. This is what we called _________.
Constant
Derivations
Symbol Table
Parse Tree
Non-Terminals have these angled brackets (< >) around them indicating that they cannot be expanded into something else.
TRUE
FALSE
This was the earliest programming languages that was easy to visualize based on the idea of the von Neumann architecture
Imperative Languages
Functional Languages
Object Oriented Languages
Concurrent Languages
A term used to describe a value that does not change throughout the execution of the program, unlike a variable
Constant
Derivations
Symbol Table
Parse Tree
An anomalous condition encountered during the execution of a program that alters the way of the program or the microprocessor to a different path.
Type Checking
Loader
Exception Handling
Aliasing
Which of the following are examples of keywords in C Language
while
if
static
All of the mentioned
These strings or symbols has a special purpose in a language that cannot be used as an identifier
Reserved Words
Keywords
Meaningful Words
Function Statements
This determines when the variable or object is created and destroyed in memory
Binding
Naming Variables
Constant
Lifetime
These are the nameless variables that they don’t have names which is allocated on the heap for dynamic data structures or for instances of objects in Object Oriented programming languages
Scalar Variables
Explicit heap-dynamic Variables
Implicit heap-dynamic Variables
Stack Dynamic Variable
These types of data contains a single data values and class of such data objects over which various operations.
Numeric Data Types
Elementary Data Types
String Data Types
Array
This refers as a structured data type composed of a fixed number of components of the same type organized as a simple linear segment.
Records
List
Vectors
Array
Which of the following is not the operations of Character String in a programming languages?
Relational operation
Formatting for input-output
Substring selection
Composed of an ordered sequence of strings
