COMPUTER SCIENCE 240 MIDTERM
PRACTICE EVALUATION 2026 QUESTIONS
WITH ANSWERS GRADED A+
⩥Which of the following languages is most likely to report a
compilation error for the following snippet of code?
int i = 3;
double n, j = 3.0;
n = i + j;
a) C++
b) VSL
c) Java
d) C. Answer: c) Java
⩥Type checking happens during compilation phase. It reinforced which
type of the following structural layers?. Answer: Contextual
⩥Converting an integer value 5 to a float number 5.0 takes.... Answer:
At least one important machine instruction to preform conversion
between data binary formats.
, ⩥The imperative programming paradigm is popular and is a part of
object-oriented computing paradigm, because it
_ (Select all
answers that apply).
a) Matches the common culture of doing things by following the step-
wise instructions.
b) Supports class inheritance and code reuse.
c) Enforces the modularity and supports the development of large
programs.
d) Is based on computer organization and thus is efficient to execute on
hardware. Answer: a) Matches the common culture of doing things by
following the step-wise instructions.
d) Is based on computer organization and thus is efficient to execute on
hardware
⩥In C++, what function can be used for inputting a string containing
spaces?
a) scanf.getline(...);
b) scanf("%s", &str);
c) cin >> str;
d) cin.getline(...);. Answer: d) cin.getline(...);
PRACTICE EVALUATION 2026 QUESTIONS
WITH ANSWERS GRADED A+
⩥Which of the following languages is most likely to report a
compilation error for the following snippet of code?
int i = 3;
double n, j = 3.0;
n = i + j;
a) C++
b) VSL
c) Java
d) C. Answer: c) Java
⩥Type checking happens during compilation phase. It reinforced which
type of the following structural layers?. Answer: Contextual
⩥Converting an integer value 5 to a float number 5.0 takes.... Answer:
At least one important machine instruction to preform conversion
between data binary formats.
, ⩥The imperative programming paradigm is popular and is a part of
object-oriented computing paradigm, because it
_ (Select all
answers that apply).
a) Matches the common culture of doing things by following the step-
wise instructions.
b) Supports class inheritance and code reuse.
c) Enforces the modularity and supports the development of large
programs.
d) Is based on computer organization and thus is efficient to execute on
hardware. Answer: a) Matches the common culture of doing things by
following the step-wise instructions.
d) Is based on computer organization and thus is efficient to execute on
hardware
⩥In C++, what function can be used for inputting a string containing
spaces?
a) scanf.getline(...);
b) scanf("%s", &str);
c) cin >> str;
d) cin.getline(...);. Answer: d) cin.getline(...);