BCEE 231 Chapter 1 -
Sample questions
1
SAMPLE EXAMINATION QUESTIONS – Chapter 1
The mid-term (final exam) will have up to 8 (25) questions for 1 (3) hours. Adjacent students will have
different exams.
Special instructions:
Closed book. No calculators. A non-electronic dictionary is permitted.
In Part 1: Pick the
best answer
among the choices listed in the right column.
In Part 2: Write the answer (e.g. a, b, or …), and its reason or justification.
One point will be given for each correct answer provided that the stated reason is sensible and
specifically related to the situation—A reason is not required for picking the last choice.
Part 1
Note: Line numbers are added for reference purpose only.
The situation
In relation to the described situation:
1. The following assignment expressions
have a common syntax error:
f(x) =
(a+b)*Area*x;
g(x, y, z) = a*sin(x*y)*exp(b*z);
A B = C;
A*B = C;
A+B*C = D;
The syntax error may be due to:
a) A variable name is too long
b) A right-hand-side variable name has illegal
character(s)
c) The left-hand-side is not a (valid) name
d) The right-hand-side expression has illegal or
missing operator(s)
e) Unbalanced parentheses
_____________
f) None of the above
2. The following expression is supposed to
compute
y
b
a
x
V
sin
2
2
+
=
:
V = x*sqrt(a*a+b*b)*Sin y;
It has an error.
The error may be due to
:
_____________
f) None of the above
3. The following expression is supposed to
compute
y
b
a
x
This
preview
has intentionally blurred sections.
Sign up to view the full version.

This is the end of the preview.
Sign up
to
access the rest of the document.
- Spring '10
- yy
- Madrid Metro, Metropolitana di Napoli, Osaka Municipal Subway, built-in function, improper function argument
-
Click to edit the document details