ENGR 200 FINAL EXAM REVIEW QUESTIONS
WITH ANSWERS AND EXPLANATIONS
| American Public University
1. Which observation would most strongly support the presence of char type?
A. A flag named valid records whether the most recent sensor reading passed a range check.
B. A variable stores one menu command such as Y or N.
C. A program reads an integer menu choice typed by the user.
D. A program uses #include <iostream> before using standard stream declarations.
Correct Answer: B. A variable stores one menu command such as Y or N.
Explanation: The selected observation most specifically demonstrates char type: a character type that can represent a
single character code.
2. Consider two independent findings. Finding A: A loop uses const string& label when it only needs to inspect
long strings. Finding B: One array holds sensor IDs while another holds readings, with matching positions
referring to the same sensor. Which conclusion correctly assigns a concept to each?
A. Both are best explained by const element reference.
B. Neither observation can be classified using an engineering or computing concept.
C. The first reflects parallel arrays; the second reflects const element reference.
D. The first reflects const element reference; the second reflects parallel arrays.
Correct Answer: D. The first reflects const element reference; the second reflects parallel arrays.
Explanation: The first observation matches const element reference, whereas the second matches parallel arrays. The
two should not be collapsed into one concept.
3. How should function overloading and recursive base case be distinguished?
A. Both terms refer to the condition that stops further self-calls in a recursive function.
B. Both terms refer to using the same function name for multiple functions distinguished by parameter lists.
C. function overloading is using the same function name for multiple functions distinguished by parameter lists;
recursive base case is the condition that stops further self-calls in a recursive function.
D. function overloading is the condition that stops further self-calls in a recursive function; recursive base case is
using the same function name for multiple functions distinguished by parameter lists.
Correct Answer: C. function overloading is using the same function name for multiple functions distinguished by
parameter lists; recursive base case is the condition that stops further self-calls in a recursive function.
Explanation: The concepts differ: function overloading is using the same function name for multiple functions
distinguished by parameter lists, whereas recursive base case is the condition that stops further self-calls in a recursive
function.
4. A team observes the following: A loop compares each stored ID with the requested ID and stops when a match
occurs. Which principle is the best match?
A. vector capacity concept
B. linear search
C. array bound
D. container pass by const reference
Correct Answer: B. linear search
Explanation: The situation is a direct example of linear search, which is checking elements sequentially until a target is
found or the collection is exhausted.
,5. Two findings must be interpreted separately. First: A running total is updated with each measurement before an
average is computed. Second: Input is processed until the user enters a sentinel value that makes the condition
false. Which option identifies the two concepts correctly?
A. Neither observation can be classified using an engineering or computing concept.
B. The first reflects while loop; the second reflects accumulator.
C. Both are best explained by accumulator.
D. The first reflects accumulator; the second reflects while loop.
Correct Answer: D. The first reflects accumulator; the second reflects while loop.
Explanation: The first observation matches accumulator, whereas the second matches while loop. The two should not
be collapsed into one concept.
6. Two otherwise similar definitions differ in accessibility when no explicit access specifier is written. Which
technical concept is operating most directly?
A. class invariant
B. struct versus class default access
C. constructor
D. getter
Correct Answer: B. struct versus class default access
Explanation: The situation is a direct example of struct versus class default access, which is the C++ rule that struct
members are public by default while class members are private by default.
7. Which correction should be made after side effect is mistakenly described as 'the stack of active function-call
frames used to hold return information and local state'?
A. an observable change to program state other than returning a value
B. the code that specifies a function's return type, name, parameters, and body
C. using the same function name for multiple functions distinguished by parameter lists
D. the stack of active function-call frames used to hold return information and local state
Correct Answer: A. an observable change to program state other than returning a value
Explanation: The correction is that side effect is an observable change to program state other than returning a value.
The mistaken wording instead describes call stack.
8. Which interpretation better fits If p points to the first array element, p + 1 points to the second element. than an
account centered on address-of operator?
A. the common conversion of an array expression to a pointer to its first element in many expressions
B. requesting storage during execution, commonly with new in introductory C++
C. address computation on pointers within an array using element-sized steps
D. the & operator that can produce the address of an object
Correct Answer: C. address computation on pointers within an array using element-sized steps
Explanation: The case follows pointer arithmetic (address computation on pointers within an array using element-sized
steps) rather than address-of operator (the & operator that can produce the address of an object).
, 9. Identify the concept that means the % operator that produces the remainder from integral division.
A. remainder operator
B. bool type
C. comment
D. compound assignment
Correct Answer: A. remainder operator
Explanation: remainder operator refers to the % operator that produces the remainder from integral division.
10. A study note assigns this definition to iteration variable: 'a loop that checks its continuation condition after the
body executes'. Which description should replace it?
A. a loop that checks its continuation condition after the body executes
B. a repetition structure in which one loop is contained inside another
C. a variable whose successive values determine the progress of a repeated computation
D. a variable that combines successive values, often by addition or multiplication
Correct Answer: C. a variable whose successive values determine the progress of a repeated computation
Explanation: The correction is that iteration variable is a variable whose successive values determine the progress of a
repeated computation. The mistaken wording instead describes posttest loop.
11. Two findings must be interpreted separately. First: A class stores resistance as a private double data member.
Second: A Sensor class groups an identifier, latest reading, and operations that update or report its state. Which
option identifies the two concepts correctly?
A. The first reflects data member; the second reflects class.
B. The first reflects class; the second reflects data member.
C. Neither observation can be classified using an engineering or computing concept.
D. Both are best explained by data member.
Correct Answer: A. The first reflects data member; the second reflects class.
Explanation: The first observation matches data member, whereas the second matches class. The two should not be
collapsed into one concept.
12. The result is: Accessing position equal to size() is outside the valid character range of a nonempty string.
Which explanation fits better than an account based on empty string?
A. the requirement that an index refer to an existing character when using unchecked indexing
B. an input operation that reads an entire line including embedded spaces until the delimiter
C. combining strings into a longer sequence
D. a string containing zero characters
Correct Answer: A. the requirement that an index refer to an existing character when using unchecked indexing
Explanation: The case follows string bounds (the requirement that an index refer to an existing character when using
unchecked indexing) rather than empty string (a string containing zero characters).
WITH ANSWERS AND EXPLANATIONS
| American Public University
1. Which observation would most strongly support the presence of char type?
A. A flag named valid records whether the most recent sensor reading passed a range check.
B. A variable stores one menu command such as Y or N.
C. A program reads an integer menu choice typed by the user.
D. A program uses #include <iostream> before using standard stream declarations.
Correct Answer: B. A variable stores one menu command such as Y or N.
Explanation: The selected observation most specifically demonstrates char type: a character type that can represent a
single character code.
2. Consider two independent findings. Finding A: A loop uses const string& label when it only needs to inspect
long strings. Finding B: One array holds sensor IDs while another holds readings, with matching positions
referring to the same sensor. Which conclusion correctly assigns a concept to each?
A. Both are best explained by const element reference.
B. Neither observation can be classified using an engineering or computing concept.
C. The first reflects parallel arrays; the second reflects const element reference.
D. The first reflects const element reference; the second reflects parallel arrays.
Correct Answer: D. The first reflects const element reference; the second reflects parallel arrays.
Explanation: The first observation matches const element reference, whereas the second matches parallel arrays. The
two should not be collapsed into one concept.
3. How should function overloading and recursive base case be distinguished?
A. Both terms refer to the condition that stops further self-calls in a recursive function.
B. Both terms refer to using the same function name for multiple functions distinguished by parameter lists.
C. function overloading is using the same function name for multiple functions distinguished by parameter lists;
recursive base case is the condition that stops further self-calls in a recursive function.
D. function overloading is the condition that stops further self-calls in a recursive function; recursive base case is
using the same function name for multiple functions distinguished by parameter lists.
Correct Answer: C. function overloading is using the same function name for multiple functions distinguished by
parameter lists; recursive base case is the condition that stops further self-calls in a recursive function.
Explanation: The concepts differ: function overloading is using the same function name for multiple functions
distinguished by parameter lists, whereas recursive base case is the condition that stops further self-calls in a recursive
function.
4. A team observes the following: A loop compares each stored ID with the requested ID and stops when a match
occurs. Which principle is the best match?
A. vector capacity concept
B. linear search
C. array bound
D. container pass by const reference
Correct Answer: B. linear search
Explanation: The situation is a direct example of linear search, which is checking elements sequentially until a target is
found or the collection is exhausted.
,5. Two findings must be interpreted separately. First: A running total is updated with each measurement before an
average is computed. Second: Input is processed until the user enters a sentinel value that makes the condition
false. Which option identifies the two concepts correctly?
A. Neither observation can be classified using an engineering or computing concept.
B. The first reflects while loop; the second reflects accumulator.
C. Both are best explained by accumulator.
D. The first reflects accumulator; the second reflects while loop.
Correct Answer: D. The first reflects accumulator; the second reflects while loop.
Explanation: The first observation matches accumulator, whereas the second matches while loop. The two should not
be collapsed into one concept.
6. Two otherwise similar definitions differ in accessibility when no explicit access specifier is written. Which
technical concept is operating most directly?
A. class invariant
B. struct versus class default access
C. constructor
D. getter
Correct Answer: B. struct versus class default access
Explanation: The situation is a direct example of struct versus class default access, which is the C++ rule that struct
members are public by default while class members are private by default.
7. Which correction should be made after side effect is mistakenly described as 'the stack of active function-call
frames used to hold return information and local state'?
A. an observable change to program state other than returning a value
B. the code that specifies a function's return type, name, parameters, and body
C. using the same function name for multiple functions distinguished by parameter lists
D. the stack of active function-call frames used to hold return information and local state
Correct Answer: A. an observable change to program state other than returning a value
Explanation: The correction is that side effect is an observable change to program state other than returning a value.
The mistaken wording instead describes call stack.
8. Which interpretation better fits If p points to the first array element, p + 1 points to the second element. than an
account centered on address-of operator?
A. the common conversion of an array expression to a pointer to its first element in many expressions
B. requesting storage during execution, commonly with new in introductory C++
C. address computation on pointers within an array using element-sized steps
D. the & operator that can produce the address of an object
Correct Answer: C. address computation on pointers within an array using element-sized steps
Explanation: The case follows pointer arithmetic (address computation on pointers within an array using element-sized
steps) rather than address-of operator (the & operator that can produce the address of an object).
, 9. Identify the concept that means the % operator that produces the remainder from integral division.
A. remainder operator
B. bool type
C. comment
D. compound assignment
Correct Answer: A. remainder operator
Explanation: remainder operator refers to the % operator that produces the remainder from integral division.
10. A study note assigns this definition to iteration variable: 'a loop that checks its continuation condition after the
body executes'. Which description should replace it?
A. a loop that checks its continuation condition after the body executes
B. a repetition structure in which one loop is contained inside another
C. a variable whose successive values determine the progress of a repeated computation
D. a variable that combines successive values, often by addition or multiplication
Correct Answer: C. a variable whose successive values determine the progress of a repeated computation
Explanation: The correction is that iteration variable is a variable whose successive values determine the progress of a
repeated computation. The mistaken wording instead describes posttest loop.
11. Two findings must be interpreted separately. First: A class stores resistance as a private double data member.
Second: A Sensor class groups an identifier, latest reading, and operations that update or report its state. Which
option identifies the two concepts correctly?
A. The first reflects data member; the second reflects class.
B. The first reflects class; the second reflects data member.
C. Neither observation can be classified using an engineering or computing concept.
D. Both are best explained by data member.
Correct Answer: A. The first reflects data member; the second reflects class.
Explanation: The first observation matches data member, whereas the second matches class. The two should not be
collapsed into one concept.
12. The result is: Accessing position equal to size() is outside the valid character range of a nonempty string.
Which explanation fits better than an account based on empty string?
A. the requirement that an index refer to an existing character when using unchecked indexing
B. an input operation that reads an entire line including embedded spaces until the delimiter
C. combining strings into a longer sequence
D. a string containing zero characters
Correct Answer: A. the requirement that an index refer to an existing character when using unchecked indexing
Explanation: The case follows string bounds (the requirement that an index refer to an existing character when using
unchecked indexing) rather than empty string (a string containing zero characters).