________ helps Internet-based applications perform like desktop applications.
a. Ajax
b. Blogging
c. RSS
d. Mashups
A function prototype can always be omitted when:
a. A function is defined before it is first invoked.
b. A function is invoked before it is first defined.
c. A function takes no arguments.
d. A function does not return a value.
Which of the following statements about scoped enumerations is false?
a. A scoped enumeration is introduced by the keywords enum class, followed by a type
name and a set of identifiers representing integer constants.
b. The identifiers in an enum class must be unique, but separate enumeration constants
can have the same integer value.
c. By convention, you should capitalize the first letter of an enum class’s name.
d. To reference a scoped enum constant, you must qualify the constant with the scoped
enum’s type name and the scope-resolution operator (:), as in MaritalStatus:SINGLE.
Which of the following is not a syntax error?
a. std::cout << ‘Hello world! ‘;
b. std::cout << “Helloworld! “;
c. std::cout << “Hello world! “;
d. std::cout << Hello world!;
When a compiler encounters a function parameter for a single-subscripted array of the
form int a[], it converts the parameter to:
a. int a
b. int &a
c. int *a
d. No conversion is necessary.
Which of the following does not display correct if answer is equal to 7 and incorrect if
answer is not equal to 7?
a. if (answer == 7) {
cout << “correct”;
}
else {
cout << “incorrect”;
}
b. cout << answer == 7 ? “correct” : “incorrect”;
c. cout << (answer == 7 ? “correct” : “incorrect”);
d. answer == 7 ? cout << “correct” : cout << “incorrect”;
C++11’s unsigned long long int type (which can be abbreviated as unsigned long long)
enables you to store values in at least ________, which can hold numbers as large as
18,446,744,073,709,551,615.
a. 2 bytes (16 bits)
b. 4 bytes (32 bits)
c. 8 bytes (64 bits)
d. 16 bytes (128 bits)
Which of the following statements is false?
a. C++ requires all variables to have a type.
b. C++ fundamental types are portable.
c. ints may be 64 bits on some machines.
d. C++ programmers frequently have to write different versions of programs for
different platforms.
When an argument is passed-by-value, changes in the called function __________
affect the original variable’s value; when an argument is passed call-by-reference,
changes in the called function __________ affect the original variable’s value.
a. Do not, do.
b. Do not, do not.
c. Do, do.
d. Do, do not.
Referencing elements outside the arraybounds with the []operator:
a. Can result in changes to the value of an unrelated variable.
b. Is impossible because C++ checks to make sure it does not happen.
c. Is a syntax error.
d. Enlarges the size of the array.
Which of the following is false?
a. An engine implements a random-number generation algorithm that produce
pseudorandom numbers.
b. A distribution controls the range of values produced by an engine, the types of those
and the statistical properties of the values.
c. The default range of a uniform_int_distribution is from 0 to 32767.
d. C++11 provides many classes that represent various random-number generation
engines and distributions.
Overloaded functions must have:
a. Different parameter lists.
b. Different return types.
c. The same number of parameters.
d. The same number of default arguments.
Type-safe linkage is ensured by:
a. Name mangling.
b. Calling the correct function.
c. The agreement of the arguments and parameters.
d. Specifying return types.
Which of the following statements is false?
a. Speaking to your computer is a form of input.
b. Playing a video is an example of output.
c. A multi-core processor implements several processors on a single integrated-circuit
chip.
d. Information in the memory unit is persistentit is retained when the computer’s power
is turned off.
Each standard library has a corresponding:
a. Function.
b. Variable type.
c. Header.
d. CD-ROM.
Which of the following is not an arithmetic operator?
a. +
b. –
c. =
d. %
Assuming that t is an array and tPtr is a pointer to that array, which expression refers to
the address of element 3 of the array?
a. *(tPtr + 3)
b. tPtr[3]
c. &t[3]
d. *(t + 3)
Which of the following is not a correct way to initialize a built-in array?
a. int n[5]{0, 7, 0, 3, 8, 2};
b. int n[]{0, 7, 0, 3, 8, 2};
c. int n[5]{7};
d. int n[5]{9, 1, 9};
The Boost Libraries ________ pointers help you avoid some key errors associated with
traditional pointers.
a. open
b. regular
c. smart
d. self-correcting
Recursion is to the base case as iteration is to what:
a. The counter.
b. A repetition structure.
c. Failure of the loop continuation test.
d. A selection structure.
________ is a communications protocol used to send information over the web.
a. HyperText Markup Language (HTML).
b. URL (Uniform Resource Locator).
c. Web 2.0
d. TCP/IP
Which of the following is a variable declaration statement?
a. int total;
b. #include <iostream>
c. int main()
d. // first string entered by user
Which of the following is false?
a. The three expressions in the for structure are optional.
b. The initialization and increment expressions can be comma-separated lists.
c. You must declare the control variable outside of the for loop.
d. A for loop can always be used to replace a while loop, and vice versa.
If a dowhile structure is used:
a. An infinite loop cannot take place.
b. Counter-controlled iteration is not possible.
c. The body of the loop will execute at least once.
d. An off-by-one error cannot occur.
Which of the following is the escape character?
a. *
b. \
c. \n
d. ”
In what order would the following operators be evaluated
-, *, /, +, %
Assume that if two operations have the same precedence, the one listed first will be
evaluated first.
a. +, -, /, *, %
b. -, +, %, *, /
c. -, *, %, +, /
d. *, /, %, -, +
A switch statement should be used:
a. As a single-selection structure.
b. As a double-selection structure.
c. As a multiple-selection structure.
d. To replace all ifelse statements.
The compiler will implicitly create a default constructor if:
a. The class does not contain any data members.
b. The programmer specifically requests that the compiler do so.
c. The class does not define any constructors.
d. The class already defines a default constructor.
All of the following are reasons to use recursion except:
a. An iterative solution is not apparent.
b. The resulting program is easier to debug.
c. It more naturally mirrors the problem.
d. It maximizes execution performance.
Which statement would be used to declare a 10-element integer array c?
a. array c<12>;
b. array c<int, 12>;
c. array<12> c;
d. array<int, 12> c;
Which of the following is a double-selection statement?
a. if.
b. ifelse.
c. dowhile.
d. switch.
A header file is typically given the filename extension:
a. .h
b. .hdr
c. .header
d. .cpp
In the expression
n = x + rand() % y;
a. y is the shifting value.
b. x is the scaling value.
c. y is the scaling value.
d. Both (a) and (b).
Using the following function definition, the parameter list is represented by:
A B (C)
{
D
}
a. A.
b. B.
c. C.
d. D.