ASU CSE 240 MIDTERM EXAM (QUIZZES QUESTIONS WITH
COMPLETE SOLUTIONS
Event-driven computing paradigm is to - ans- d d d d d dd
define a set of events and write a handler for each event
d d d d d d d d d d d
In contrast to Web 1.0, what is the key function of Web 2.0? - ans-
d d d d d d d d d d d d d dd
Web is the computing platformd d d d
What programming language impacts the readability of the programs written in this language
d d d d d d d d d d d d
? - ans-Control Structures
d dd d
Syntax Design d
Data Structures d
What is a feature of object-oriented computing? - ans-encapsulation of states
d d d d d d d dd d d
Which command will have a loop expressed in a syntax graph? - ans-switch
d d d d d d d d d d d dd
If your program was designed to print "Hello World" ten (10) times, but during execution, it print
d d d d d d d d d d d d d d d d
ed eleven (11) times. What typeof error is it? - ans-Semantics Error
d d d d d d d d d dd d
A computer program can be broke down into several structural layers. Which of the followings
d d d d d d d d d d d d d d d
belong to these structural layers. Select all that applies. - ans-Synctatic
d d d d d d d d d dd
Contextual
Semantics
For the following BNF ruleset, which are terminal symbols? Select all that apply.
d d d d d d d d d d d d
<char> ::= a | b | c | ... | x | y | z d d d d d d d d d d d d d d
<identifier> ::= <char> | <char> <identifier> - ans-y d d d d d d dd
a
What does the I (pipe) symbol in a BNF rule mean? - ans-It is an "or" operation
d d d d d d d d d d d dd d d d d
Can the identifier "base_variable" be created from the following BNF ruleset?
d d d d d d d d d d
<char> ::= a | b | c | ... | s | ... | x | y | z d d d d d d d d d d d d d d d d d d
<identifier> ::= <char> | <char> <identifier> - ans-No - d d d d d d dd d
there is an underscore in the identifier name that cannot be generated.
d d d d d d d d d d d d
What is the main reason of applying two-
d d d d d d d
step translation of high level programming language? - ans-One compiler for all machines
d d d d d d d dd d d d d
If you like to see accurate debugging information, which of the following program processing
d d d d d d d d d d d d d d
would you recommend? - ans-interpretationd d d dd
, A final method in java defines - ans-an inline function
d d d d d d dd d d
Macros-Processing in C takes place during which phase? - ans-Pre-processing d d d d d d d d dd
What is "func" in this C program example? d d d d d d d
#include <stdio.h> d
#define func(x, y) (x > y) ? y : x d d d d d d d d d
int main() d
{
int x = 10;
d d d d
int y = 9;
d d d d
int z = func(x, y);
d d d d d
} - ans-A macro
d dd d
Explicit type conversion is commonly refer to as - ans-Casting d d d d d d d d dd
Converting an integer value 5 to a float number 5.0 takes - ans- d d d d d d d d d d d dd
more than two machine instructions d d d d
Implicit type conversion is commonly referred to as - ans-Coercion d d d d d d d d dd
Which language will report a compilation error for the following snippet of code?
d d d d d d d d d d d d
int i = 3; d d d
double n, j = 3.0; d d d d
n = i + j; - ans-Java
d d d d d dd
Which of the following orthogonality describe this example: If a block allows one statement, it s
d d d d d d d d d d d d d d d
hould allow zero or more statements within that same block. - ans-Number orthogonality
d d d d d d d d d d dd d
Why do we need to flush the input buffer? - ans-
d d d d d d d d d dd
An unformatted input can read the newline character left from the previous input operation.
d d d d d d d d d d d d d
The imperative programming paradigm is popular and is a part of object oriented computing p
d d d d d d d d d d d d d d
aradigm, because it - ans-matches the culture of doing things by following the step- d d d dd d d d d d d d d d
wise instructions. d
is based on computer organization and thus is efficient to execute on hardware.
d d d d d d d d d d d d
A data type is defined by - ans-the operations allowed
d d d d d d dd d d
the values allowed d d
A variable declaration can involve the following attributes: - ans-scope
d d d d d d d d dd
type
COMPLETE SOLUTIONS
Event-driven computing paradigm is to - ans- d d d d d dd
define a set of events and write a handler for each event
d d d d d d d d d d d
In contrast to Web 1.0, what is the key function of Web 2.0? - ans-
d d d d d d d d d d d d d dd
Web is the computing platformd d d d
What programming language impacts the readability of the programs written in this language
d d d d d d d d d d d d
? - ans-Control Structures
d dd d
Syntax Design d
Data Structures d
What is a feature of object-oriented computing? - ans-encapsulation of states
d d d d d d d dd d d
Which command will have a loop expressed in a syntax graph? - ans-switch
d d d d d d d d d d d dd
If your program was designed to print "Hello World" ten (10) times, but during execution, it print
d d d d d d d d d d d d d d d d
ed eleven (11) times. What typeof error is it? - ans-Semantics Error
d d d d d d d d d dd d
A computer program can be broke down into several structural layers. Which of the followings
d d d d d d d d d d d d d d d
belong to these structural layers. Select all that applies. - ans-Synctatic
d d d d d d d d d dd
Contextual
Semantics
For the following BNF ruleset, which are terminal symbols? Select all that apply.
d d d d d d d d d d d d
<char> ::= a | b | c | ... | x | y | z d d d d d d d d d d d d d d
<identifier> ::= <char> | <char> <identifier> - ans-y d d d d d d dd
a
What does the I (pipe) symbol in a BNF rule mean? - ans-It is an "or" operation
d d d d d d d d d d d dd d d d d
Can the identifier "base_variable" be created from the following BNF ruleset?
d d d d d d d d d d
<char> ::= a | b | c | ... | s | ... | x | y | z d d d d d d d d d d d d d d d d d d
<identifier> ::= <char> | <char> <identifier> - ans-No - d d d d d d dd d
there is an underscore in the identifier name that cannot be generated.
d d d d d d d d d d d d
What is the main reason of applying two-
d d d d d d d
step translation of high level programming language? - ans-One compiler for all machines
d d d d d d d dd d d d d
If you like to see accurate debugging information, which of the following program processing
d d d d d d d d d d d d d d
would you recommend? - ans-interpretationd d d dd
, A final method in java defines - ans-an inline function
d d d d d d dd d d
Macros-Processing in C takes place during which phase? - ans-Pre-processing d d d d d d d d dd
What is "func" in this C program example? d d d d d d d
#include <stdio.h> d
#define func(x, y) (x > y) ? y : x d d d d d d d d d
int main() d
{
int x = 10;
d d d d
int y = 9;
d d d d
int z = func(x, y);
d d d d d
} - ans-A macro
d dd d
Explicit type conversion is commonly refer to as - ans-Casting d d d d d d d d dd
Converting an integer value 5 to a float number 5.0 takes - ans- d d d d d d d d d d d dd
more than two machine instructions d d d d
Implicit type conversion is commonly referred to as - ans-Coercion d d d d d d d d dd
Which language will report a compilation error for the following snippet of code?
d d d d d d d d d d d d
int i = 3; d d d
double n, j = 3.0; d d d d
n = i + j; - ans-Java
d d d d d dd
Which of the following orthogonality describe this example: If a block allows one statement, it s
d d d d d d d d d d d d d d d
hould allow zero or more statements within that same block. - ans-Number orthogonality
d d d d d d d d d d dd d
Why do we need to flush the input buffer? - ans-
d d d d d d d d d dd
An unformatted input can read the newline character left from the previous input operation.
d d d d d d d d d d d d d
The imperative programming paradigm is popular and is a part of object oriented computing p
d d d d d d d d d d d d d d
aradigm, because it - ans-matches the culture of doing things by following the step- d d d dd d d d d d d d d d
wise instructions. d
is based on computer organization and thus is efficient to execute on hardware.
d d d d d d d d d d d d
A data type is defined by - ans-the operations allowed
d d d d d d dd d d
the values allowed d d
A variable declaration can involve the following attributes: - ans-scope
d d d d d d d d dd
type