CAPP 44715

subject Type Homework Help
subject Pages 10
subject Words 1474
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
(*max)(num1, num2, num3);:
a. Is the header for function max.
b. Is a call to the function pointed to by max.
c. Is the prototype for function max.
d. Is a declaration of a pointer to a function called max.
Specifying the order in which statements are to be executed in a computer program is
called:
a. An algorithm.
b. Transfer of control.
c. Program control.
d. Pseudocode.
Which of the following is false?
a. The effects of break and continue statements can be achieved by structured
programming techniques.
b. break and continue statements can make a program perform faster than with the
page-pf2
corresponding structured techniques.
c. Many programmers feel that break and continue violate structured programming.
d. You should always try to write the fastest, smallest code possible before attempting to
make it simple and correct.
Which of the following is not one of the six logical units of a computer?
a. Input unit.
b. Output unit.
c. Central processing unit.
d. Printer.
[C++14]: Which of the statements a), b) and c) about C++14 is false?
a. It added several language features.
b. It added several C++ Standard Library Enhancements.
c. It added several bugs from C++11.
d. None of the above statements is false.
page-pf3
Which of the following is not one of the three general types of computer languages?
a. Machine languages.
b. Assembly languages.
c. High-Level languages.
d. Spoken languages.
Which of the following is false about a function to which a built-in array is being
passed?
a. It always knows the size of the built-in array that is being passed.
b. It is being passed the address of the first element in the built-in array.
c. It is able to modify the values stored in the built-in array.
d. The built-in array's name is used as an argument in the function call.
page-pf4
Given a built-in array of ints named values, which of the following statements would
sort the array?
a. sort(values.begin(), values.end());
b. sort(values.array_begin(), values.array_end());
c. sort(begin(values), end(values));
d. sort(array_begin(values), array_end(values));
A function that prints a string by using pointer arithmetic such as ++ptr to output each
character should have a parameter that is:
a. A nonconstant pointer to nonconstant data.
b. A nonconstant pointer to constant data.
c. A constant pointer to nonconstant data.
d. A constant pointer to constant data.
End-of-line comments that should be ignored by the compiler are denoted using:
a. Two forward slashes (//).
page-pf5
b. Three forward slashes (///).
c. A slash and a star (/*).
d. A slash and two stars (/**).
If a set of functions have the same program logic and operations and differ only in the
data type(s) each receives as argument(s) then a(n) __________ should be used.
a. Overloaded function.
b. Recursive function.
c. Macro.
d. Function template.
Which of the following statements is false?
a. The number and order of arguments in a function call must match the number and
order of parameters in the function definition's parameter list.
b. Every function body is delimited by an opening left brace and a closing right brace.
Within the braces are one or more statements that perform the function's task(s).
c. When program execution reaches a function's closing brace, the function returns to its
page-pf6
caller.
d. None of the above is false.
In C++, the condition (4 > y > 1):
a. Evaluates correctly and could be replaced by (4 > y && y > 1).
b. Does not evaluate correctly and should be replaced by (4 > y && y > 1).
c. Evaluates correctly and could not be replaced by (4 > y && y > 1).
d. Does not evaluate correctly and should not be replaced by (4 > y && y > 1).
Which of the following statements about nested ifelse statements is true?
a. An ifelse statement may not be nested in another nested ifelse.
b. Each ifelse statement must contain only a simple condition.
c. In an if body, an inner ifelse executes only if the outer if statement's condition is true.
d. The statement(s) in an inner if always execute(s) if its condition is true.
page-pf7
Which of the following statements is true?
a. Interpreted programs run faster than compiled programs.
b. Compilers translate high-level language programs into machine language programs.
c. Interpreter programs typically use machine language as input.
d. None of the above.
Which of the following is false?
a. The last element of an array has position number one less than the array size.
b. The position number contained within square brackets is called a subscript.
c. A subscript cannot be an expression.
d. All of the above.
page-pf8
A double subscripted array declared as array<array<int, 5>, 3> values; has how many
elements?
a. 15
b. 13
c. 10
d. 8
sizeof:
a. Is a binary operator.
b. Returns the total number of elements in an array.
c. Usually returns a double.
d. Returns the total number of bytes in a variable.
A function that modifies an array by using pointer arithmetic such as ++ptr to process
every value of the array should have a parameter that is:
a. A nonconstant pointer to nonconstant data.
page-pf9
b. A nonconstant pointer to constant data.
c. A constant pointer to nonconstant data.
d. A constant pointer to constant data.
Using a while loop's counter-control variable in a calculation after the loop ends often
causes a common logic error called:
a. A fatal logic error.
b. A counter exception.
c. A syntax error.
d. An off-by-one error.
You can sort an array with the Standard Library's:
a. sort function.
b. sort_array function.
c. array_sort function.
d. None of the above.
page-pfa
Which of the following is not a correct way to initialize the array named n?
a. array<int, 5> n{0, 7, 0, 3, 8};
b. array<int, 5> n{0, 7, 0, 3, 8, 2};
c. array<int, 5> n{7};
d. array<int, 5> n{9, 1, 9};
Which of the following statements is false?
a. Class names, member function names and data member names are all identifiers.
b. By convention, variable-name identifiers begin with an uppercase letter, and every
word in the name after the first word begins with a capital letter; this naming
convention is known as camel case.
c. Also by convention, class names begin with an initial uppercase letter, and member
function and data member names begin with an initial lowercase letter.
d. All of the above are true.
page-pfb
A member function that does not, and should not, modify the object on which it's called
is declared with ________ to the right of its parameter list.
a. final
b. const
c. firm
d. immutable
How many times will the following loop print hello?
i = 1;
while (i <= 10) {
cout << "hello";
}
a. 0.
b. 9.
c. 10.
d. An infinite number of times.
page-pfc
A recursive function is a function that:
a. Returns a double.
b. Takes 3 arguments.
c. Calls itself, directly or indirectly.
d. Is inside of another function.
Which of the following does not declare a 2-by-2 array and set all four of its elements
to 0?
a. array<array<int,2>, 2> b;
b[0][0] = b[0][1] = b[1][0] = b[1][1] = 0;
b. array<array<int, 2>, 2> b = {0};
c. array<array<int, 2>, 2> b;
for (auto const &row : b) {
for (auto &element : row) {
element = 0;
}
page-pfd
}
d. All of the above initialize all four of the array elements to 0.
The function prototype
double mySqrt(int x);
a. Declares a function called mySqrt which takes an integer as an argument and returns
a double.
b. Defines a function called double which calculates square roots.
c. Defines a function called mySqrt which takes an argument of type x and returns a
double.
d. Declares a function called mySqrt which takes a double as an argument and returns
an integer.
Which is the output of the following statements?
std::cout << "Hello ";
std::cout << "World";
page-pfe
a. Hello World
b. World Hello
c. Hello
World
d. World
Hello
Which statement about exception handling is false?
a. Call the exception object's what member function to get the error message that's
stored in the exception object.
b. Bounds checking is performed at execution time with vector member function at, and
if a subscript is within the bounds of the array, the member function throws an
out_of_bounds exception.
c. The catch block contains the code that handles an exception if one occurs.
d. None of the above statements in false.
page-pff
Which of the following is a parameterized stream manipulator used to format output?
a. setw
b. right
c. left
d. fixed
Variables are also known as:
a. lvalues, but can be used as rvalues.
b. lvalues, and cannot be used as rvalues.
c. rvalues, and cannot be used as lvalues.
d. Constant variables.
Assuming that x and y are equal to 3 and 2, respectively, after the statement x -= y
executes, the values of x and y will be:
a. x: 5; y: 3
b. x: 3; y: -1
page-pf10
c. x: 3; y: 5
d. x: 1; y: 2
A block:
a. Must contain exactly three statements.
b. Cannot contain declarations.
c. Is a compound statement.
d. Is represented by placing a semicolon (;) where a statement would normally be.

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.