ASU CSE 240 MIDTERM QUESTIONS WITH COMPLETE SOLUTIONS
A programming language can belong to multiple paradigms (T/F) - ans-True
d d d d d d d d d d
Features of the imperative or procedural paradigm includes - ans-
d d d d d d d d d
Manipulation of named data(variables) and conditional statements d d d d d d
(T/
F) Logic programming languages divide the program into reasonable sized pieces named fun
d d d d d d d d d d d d
ctions or procedures or modules or subroutines - ans-False
d d d d d d d d
Direct execution of one statement at a time sequentially - ans-Interpretation
d d d d d d d d d d
simpler semantics and computation expressions in terms of mathematical function are featur
d d d d d d d d d d d
es of which paradigm? - ans-Functional
d d d d d
Expressing computation in terms of logic predicates is a feature of which paradigm? - ans-
d d d d d d d d d d d d d d
Logic
Inheritance, classes & objects are features of which paradigm - ans-Object Oriented
d d d d d d d d d d d
A set of principles, concepts and methods that is commonly accepted by members of a group
d d d d d d d d d d d d d d d d
or community - ans-Programming Paradigm
d d d d
(T/F) Prolog is a functional programming language? - ans-False
d d d d d d d d
(T/F) the compiler executes the program - ans-False
d d d d d d d
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 - ans- d d d
type matching, parameters type in a function declaration should match these in the function c
d d d d d d d d d d d d d d
all, unicity d
(T/F) Functional programming languages are low-level languages - ans-False
d d d d d d d d
(T/F) 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 d d
ans-False
d
They syntactic structure of imperative programming languages normally include which of the
d d d d d d d d d d d d
following units? d
A. Operators B. keywords C. identifiers D. conditional statements E. loop statements F. varia
d d d d d d d d d d d d d d
ble declaration - ans-D, E, F
d d d d d
, What programming language uses two- d d d d
step translation with intermediate codes for execution? - ans-JAVA
d d d d d d d d
(T/
F) 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 d d
ans-True
d
(T/F) during compilation, all statements of a program in a high-
d d d d d d d d d d
level language are converted to a low-level language. - ans-True
d d d d d d d d d
A set of primary values and the operations defined on these values - ans-data type
d d d d d d d d d d d d d d
The lexical structure of all programming languages are similar and include which of the followi
d d d d d d d d d d d d d d
ng units? d
A. Identifiers B. Loop statements C. Keywords D. operators E. literals F. variable declaration -
d d d d d d d d d d d d d d d
ans-A, C, D, E
d d d d
What does the follow code print? d d d d d
int foo(int *n) { d d d
*n = 30;
d d d
}int main() { d d
int i=15;
d d
foo(&i);
d
printf("i=%d\n",i);
d
i=10;
d
foo(&i);
d
printf("i=%d\n",i);
d
return 0;} - ans-i = 30
d d d d d d
i = 30
d d
What does this program print on the screen? d d d d d d d
#include <stdio.h> d
int main() { d d
int i=3, *j, k;
d d d d
j=&i;
d
printf("%d\n",i**j*i-*j);
d
return 0;
d d
} - ans-24
d d
A classification that specifies which type of value a variable has and what type of mathematica
d d d d d d d d d d d d d d d
l, logical or rational operations can be applied to it - ans-Data type
d d d d d d d d d d d d
A name given to a storage location - ans-Variable
d d d d d d d d
Fixed value that the program may not alter during its execution - ans-Constant
d d d d d d d d d d d d
A programming language can belong to multiple paradigms (T/F) - ans-True
d d d d d d d d d d
Features of the imperative or procedural paradigm includes - ans-
d d d d d d d d d
Manipulation of named data(variables) and conditional statements d d d d d d
(T/
F) Logic programming languages divide the program into reasonable sized pieces named fun
d d d d d d d d d d d d
ctions or procedures or modules or subroutines - ans-False
d d d d d d d d
Direct execution of one statement at a time sequentially - ans-Interpretation
d d d d d d d d d d
simpler semantics and computation expressions in terms of mathematical function are featur
d d d d d d d d d d d
es of which paradigm? - ans-Functional
d d d d d
Expressing computation in terms of logic predicates is a feature of which paradigm? - ans-
d d d d d d d d d d d d d d
Logic
Inheritance, classes & objects are features of which paradigm - ans-Object Oriented
d d d d d d d d d d d
A set of principles, concepts and methods that is commonly accepted by members of a group
d d d d d d d d d d d d d d d d
or community - ans-Programming Paradigm
d d d d
(T/F) Prolog is a functional programming language? - ans-False
d d d d d d d d
(T/F) the compiler executes the program - ans-False
d d d d d d d
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 - ans- d d d
type matching, parameters type in a function declaration should match these in the function c
d d d d d d d d d d d d d d
all, unicity d
(T/F) Functional programming languages are low-level languages - ans-False
d d d d d d d d
(T/F) 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 d d
ans-False
d
They syntactic structure of imperative programming languages normally include which of the
d d d d d d d d d d d d
following units? d
A. Operators B. keywords C. identifiers D. conditional statements E. loop statements F. varia
d d d d d d d d d d d d d d
ble declaration - ans-D, E, F
d d d d d
, What programming language uses two- d d d d
step translation with intermediate codes for execution? - ans-JAVA
d d d d d d d d
(T/
F) 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 d d
ans-True
d
(T/F) during compilation, all statements of a program in a high-
d d d d d d d d d d
level language are converted to a low-level language. - ans-True
d d d d d d d d d
A set of primary values and the operations defined on these values - ans-data type
d d d d d d d d d d d d d d
The lexical structure of all programming languages are similar and include which of the followi
d d d d d d d d d d d d d d
ng units? d
A. Identifiers B. Loop statements C. Keywords D. operators E. literals F. variable declaration -
d d d d d d d d d d d d d d d
ans-A, C, D, E
d d d d
What does the follow code print? d d d d d
int foo(int *n) { d d d
*n = 30;
d d d
}int main() { d d
int i=15;
d d
foo(&i);
d
printf("i=%d\n",i);
d
i=10;
d
foo(&i);
d
printf("i=%d\n",i);
d
return 0;} - ans-i = 30
d d d d d d
i = 30
d d
What does this program print on the screen? d d d d d d d
#include <stdio.h> d
int main() { d d
int i=3, *j, k;
d d d d
j=&i;
d
printf("%d\n",i**j*i-*j);
d
return 0;
d d
} - ans-24
d d
A classification that specifies which type of value a variable has and what type of mathematica
d d d d d d d d d d d d d d d
l, logical or rational operations can be applied to it - ans-Data type
d d d d d d d d d d d d
A name given to a storage location - ans-Variable
d d d d d d d d
Fixed value that the program may not alter during its execution - ans-Constant
d d d d d d d d d d d d