CSE 240 MIDTERM STUDY ASU GONZALES QUESTIONS WITH
ANSWERS
Interpretation of a program is the direct execution of one statement at a time sequentially.
d d d d d d d d d d d d d d
True or False? - ans-True
d d d dd
What kind of error is in the following line:-
d d d d d d d d
int a = ((2*45)*(6/2) hello (4+90));
d d d d d
Lexical Error d
Semantic Error d
Correct! Syntactic Error d d
None of the above - ans-What kind of error is in the following line:-
d d d d dd d d d d d d d d
int a = ((2*45)*(6/2) hello (4+90));
d d d d d
Lexical Error d
Semantic Error d
Syntactic Error d
None of the above d d d
The syntactic structure of imperative programming languages normally include which of the f
d d d d d d d d d d d d
ollowing units: d
operators
keywords
identifiers
conditional statements d
loop statements
d
variable declaration - ans-conditional statements
d d dd d
loop statements
d
variable declaration d
The compiler execute the program.
d d d d
True or False - ans-False
d d d dd
,The semantic structure of imperative programming languages normally include which of the f
d d d d d d d d d d d d
ollowing validations: d
type matchingd
division by zero d d
a variable name should start with a letter, '$' or '_'
d d d d d d d d d d
parameters type in a function declaration should match these in the function call.
d d d d d d d d d d d d
statement should end with a ';' d d d d d
unicity - ans-type matching d dd d
parameters type in a function declaration should match these in the function call.
d d d d d d d d d d d d
unicity
Compilation of a program is to execute all the statements of the program completely.
d d d d d d d d d d d d d
True or False - ans-True
d d d dd
During compilation, all the statements of a program in a high-
d d d d d d d d d d
level language are converted (translated) to a low-
d d d d d d d
level language (such as assembly language).
d d d d d
True or False - ans-True
d d d dd
This programming language uses two-
d d d d
step translation with intermediate codes for execution.
d d d d d d
C
C++
Java
C#
LISP - ans-Java d dd
The lexical structure of all programming languages are similar and normally include which of t
d d d d d d d d d d d d d d
he following units
d d
identifiers
loop statements
d
keywords
operators
, literals - ans-identifiers d dd
keywords
operators
literals
What is a data type? d d d d
a specialized format for organizing and storing data
d d d d d d d
a storage location paired with an associated symbolic name
d d d d d d d d
a piece of information
d d d
a set of primary values and the operations defined on these values - ans-
d d d d d d d d d d d d dd
a set of primary values and the operations defined on these values
d d d d d d d d d d d
Considering the following code d d d
struct emp { d d
int id;
d
char *name; d
};
struct emp john; d d
Which of the following lines are correct?
d d d d d d
int a = 1;
d d d
char b[ ] = "John Doe";
d d d d d
emp.id = a; d d
emp.name = b; d d
printf ("%d, %s", emp.id, emp.name);
d d d d
int a = 1;
d d d
char b[ ] = "John Doe";
d d d d d
john.id = b; d d
john.name = a; d d
printf ("%d, %s", john.id, john.name);
d d d d
int a = 1;
d d d
char b[ ] = "John Doe";
d d d d d
john.id = a; d d
john.name = b; d d
printf ("%d, %s", john.id, john.name);
d d d d
int a = 1;
d d d
char b[ ] = "John Doe";
d d d d d
ANSWERS
Interpretation of a program is the direct execution of one statement at a time sequentially.
d d d d d d d d d d d d d d
True or False? - ans-True
d d d dd
What kind of error is in the following line:-
d d d d d d d d
int a = ((2*45)*(6/2) hello (4+90));
d d d d d
Lexical Error d
Semantic Error d
Correct! Syntactic Error d d
None of the above - ans-What kind of error is in the following line:-
d d d d dd d d d d d d d d
int a = ((2*45)*(6/2) hello (4+90));
d d d d d
Lexical Error d
Semantic Error d
Syntactic Error d
None of the above d d d
The syntactic structure of imperative programming languages normally include which of the f
d d d d d d d d d d d d
ollowing units: d
operators
keywords
identifiers
conditional statements d
loop statements
d
variable declaration - ans-conditional statements
d d dd d
loop statements
d
variable declaration d
The compiler execute the program.
d d d d
True or False - ans-False
d d d dd
,The semantic structure of imperative programming languages normally include which of the f
d d d d d d d d d d d d
ollowing validations: d
type matchingd
division by zero d d
a variable name should start with a letter, '$' or '_'
d d d d d d d d d d
parameters type in a function declaration should match these in the function call.
d d d d d d d d d d d d
statement should end with a ';' d d d d d
unicity - ans-type matching d dd d
parameters type in a function declaration should match these in the function call.
d d d d d d d d d d d d
unicity
Compilation of a program is to execute all the statements of the program completely.
d d d d d d d d d d d d d
True or False - ans-True
d d d dd
During compilation, all the statements of a program in a high-
d d d d d d d d d d
level language are converted (translated) to a low-
d d d d d d d
level language (such as assembly language).
d d d d d
True or False - ans-True
d d d dd
This programming language uses two-
d d d d
step translation with intermediate codes for execution.
d d d d d d
C
C++
Java
C#
LISP - ans-Java d dd
The lexical structure of all programming languages are similar and normally include which of t
d d d d d d d d d d d d d d
he following units
d d
identifiers
loop statements
d
keywords
operators
, literals - ans-identifiers d dd
keywords
operators
literals
What is a data type? d d d d
a specialized format for organizing and storing data
d d d d d d d
a storage location paired with an associated symbolic name
d d d d d d d d
a piece of information
d d d
a set of primary values and the operations defined on these values - ans-
d d d d d d d d d d d d dd
a set of primary values and the operations defined on these values
d d d d d d d d d d d
Considering the following code d d d
struct emp { d d
int id;
d
char *name; d
};
struct emp john; d d
Which of the following lines are correct?
d d d d d d
int a = 1;
d d d
char b[ ] = "John Doe";
d d d d d
emp.id = a; d d
emp.name = b; d d
printf ("%d, %s", emp.id, emp.name);
d d d d
int a = 1;
d d d
char b[ ] = "John Doe";
d d d d d
john.id = b; d d
john.name = a; d d
printf ("%d, %s", john.id, john.name);
d d d d
int a = 1;
d d d
char b[ ] = "John Doe";
d d d d d
john.id = a; d d
john.name = b; d d
printf ("%d, %s", john.id, john.name);
d d d d
int a = 1;
d d d
char b[ ] = "John Doe";
d d d d d