CS 72233

subject Type Homework Help
subject Pages 9
subject Words 1501
subject Authors Harvey Deitel, Paul Deitel

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
switch can be used to test:
a. int constants.
b. float constants.
c. string constants.
d. all types of constants.
Which of the following gives the number of elements in the array int r[10]?
a. sizeof r
b. sizeof (*r)
c. sizeof r / sizeof (int)
d. sizeof (*r) / sizeof (int)
Which of the following is nota goal stated by the creator of C++ for the new C++
standard?
a. Make C++ easier to learn.
b. Improve library building capabilities.
page-pf2
c. Make C++ an open source programming language.
d. Increase compatibility with the C programming language.
Which of the following C++ Standard Library headers does not contain a C++ Standard
Library container class?
a. <vector>.
b. <list>.
c. <stack>.
d. <string>.
Which of the following data items are arranged from the smallest to the largest in the
data hierarchy.
a. records, characters, fields, bits, files.
b. bits, files, fields, records, characters.
c. fields, characters, bits, files, records.
d. bits, characters, fields, records, files.
page-pf3
An activation record will be popped off the function call stack whenever:
a. A function returns control to its caller.
b. A function calls another function.
c. A function calls itself.
d. A function declares a local variable.
Which of the following is true?
a. C++ does not provide any capabilities for generating random numbers that cannot be
predicted.
b. C++11 provides random number capabilities that can produce nondeterministic
random numbersa set of random numbers that can"t be predicted.
c. Random numbers produced by the rand function are nondeterministic.
d. None of the above.
page-pf4
To make numeric literals more readable, C++14 allows you to insert between groups of
digits in numeric literals the digit separator ' (a single-quote character).
a. , (a comma)
b. ^ (a caret)
c. ' (a single quote)
d. * (an asterisk)
Linear search can be used on:
a. Unsorted arrays.
b. Sorted arrays.
c. Integer arrays.
d. Any of the above.
Which of the following is a compilation error?
page-pf5
a. Neglecting to declare a local variable in a function before it is used.
b. Using a triple equals sign instead of a double equals sign in the condition of an if
statement.
c. Omitting the left and right parentheses for the condition of an if statement.
d. All of the above.
Consider the execution of the following for loop
for (int x = 1; x < 5; increment) {
cout << x + 1 << endl;
}
If the last value printed is 5, which of the following might have been used for
increment?
a. x++
b. x += 1
c. ++x
d. Any of the above.
page-pf6
Which of the following statements could potentially change the value of number2?
a. std::cin >> number2;
b. sum = number1 + number2;
c. number1 = number2;
d. std::cout << number2;
Comparing pointers and performing pointer arithmetic on them is meaningless unless:
a. They point to elements of the same array.
b. You are trying to compare and perform pointer arithmetic on the values to which they
point.
c. They point to arrays of equal size.
d. They point to arrays of the same type.
Which of the following statements about UML class diagrams is false?
a. Like operations, the UML models constructors in the third compartment of a class
diagram.
b. To distinguish a constructor from the class's operations, the UML requires that the
page-pf7
word "constructor" be enclosed in guillemets and placed before the constructor's name.
c. It's customary to list constructors before other operations in the third compartment.
d. All of the above are true.
In an activity diagram for an algorithm, what does a solid circle surrounded by a hollow
circle represent?
a. Initial state.
b. Final state.
c. Action state.
d. Transition.
The OR (||) operator:
a. Has higher precedence than the AND (&&) operator.
b. Stops evaluation upon finding one condition to be true.
c. Associates from right to left.
d. Is a ternary operator.
page-pf8
Which software product release category is "generally feature complete and supposedly
bug free, and ready for use by the community?"
a. Alpha.
b. Beta.
c. Release candidate.
d. Continuous beta.
Which of the following will not increment c by 1?
a. c + 1;
b. c++;
c. ++c;
d. c += 1;
page-pf9
The escape sequence for a newline is:
a. \n
b. \t
c. \r
d. \a
Converting from type ________ to type ________ will result in the loss of data.
a. bool, char.
b. float, double.
c. int, char.
d. short, long.
Functions can:
a. Be used as building blocks to create new programs.
b. Return a result to the caller function.
page-pfa
c. Be reused any number of times.
d. Do all of the above.
The data type bool:
a. Can take on values true and false.
b. Can take on any expression as a value.
c. Can take on values -1, 0 or 1.
d. Can only be used in a selection statement.
Which of the following is not true of class template vector?
a. The size of a vector can be changed after it is declared.
b. A vector can be assigned to another vector by using the assignment operator.
c. A vector object can be initialized with a copy of another vector by invoking the copy
constructor.
d. A vector can store only data of type int.
page-pfb
Which of the following statements about the C programming language is false?
a. C was implemented in 1972 by Dennis Ritchie at Bell Laboratories.
b. With careful design, it's possible to write C programs that are portable to most
computers.
c. C initially became widely known as the Windows operating system's development
language.
d. Today, most of the code for general-purpose operating systems is written in C or C+
+.
The std::endl stream manipulator________.
a. inputs a newline.
b. flushes the output buffer.
c. outputs a newline and flushes the output buffer.
d. terminates the program.
page-pfc
What is the final value of x after performing the following operations?
int x{21};
double y{6};
double z{14};
y = x / z;
x = 5.5 * y;
a. 8.25.
b. 5.5.
c. 5.
d. 8.
An array is not:
a. A consecutive group of memory locations.
b. Subscripted by integers.
c. Made up of different data types.
d. None of the above.
page-pfd
Which of the following is correct when labeling cases in a switch structure?
a. case1:
b. Case1:
c. case 1:
d. Case 1:
To call a member function for a specific object, you specify the object's name, followed
by a(n) ________, then the member function name and a set of parentheses.
a. dot operator
b. colon
c. ::
d. ->
page-pfe
Which statement is false?
a. Classes are reusable software components.
b. A class is to an object as a blueprint is to a house.
c. Performing a task in a program requires a method.
d. A class is an instance of its object.
Which of the following is false?
a. break and continue statements alter the flow of control.
b. continue statements skip the remaining statements in current iteration of the body of
the loop in which they are embedded.
c. break statements exit from the loop in which they are embedded.
d. continue and break statements may be embedded only within iteration statements.

Trusted by Thousands of
Students

Here are what students say about us.

Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.