CAPP 85937

subject Type Homework Help
subject Pages 8
subject Words 782
subject Authors Harvey Deitel, Paul J. Deitel

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
In indefinite iteration, an input value
(a) should always be evaluated before being processed
(b) should always be processed directly after it is entered
(c) should never be modified
(d) can be entered, processed, and evaluated in any order
Q2: Which of the following statements about friend functions and friend classes is
false?
a. A class can either grant friendship to or take friendship from another class using the
friend keyword.
b. A friend declaration can appear anywhere in a class definition.
c. A friend of a class can access all of its private data member and member functions.
d. The friendship relationship is neither symmetric nor transitive.
Function feof __________.
a) forces an end-of-file condition
page-pf2
b) determines whether the end-of-file indicator is set for a file
c) sets the end-of-file indicator for a file
d) flushes the contents of the file from the current position to the end
Q2: Calling a member function of an object requires which item?
a. The dot operator.
b. Open and close braces.
c. The class name.
d. None of the above.
A field width ________ be included in the format control string of the scanf statement.
(a) can
(b) cannot
(c) must
(d) none of these
page-pf3
Q1: A function template can be overloaded by:
a. Using other function templates with the same function name and parameters.
b. Using non-template functions with the same name and different parameters.
c. Using non-template functions with a different name but the same parameters.
d. Using other function templates with a different name but the same parameters.
Q1: End-of-line comments that should be ignored by the compiler are denoted using:
a.Two forward slashes ( // ).
b.Three forward slashes ( /// ).
c.A slash and a star ( /* ).
d.A slash and two stars (/** ).
page-pf4
Which is not a scope for an identifier?
a) function scope
b) record scope
c) block scope
d) function-prototype scope
Q4: dynamic_cast is often used to:
a. Perform type checking for objects.
b. Convert pointers to strings.
c. Upcast pointers.
d. Downcast pointers.
Q3: Type-safe linkage is ensured by:
a. Name mangling.
b. Calling the correct function.
page-pf5
c. The agreement of the arguments and parameters.
d. Specifying return types.
Q1: Which of the following outputs does not guarantee that the uppercase flag has been
set?
a. All hexadecimal numbers appear in the form 0X87.
b. All numbers written in scientific notation appear the form 6.45E+010.
c. All text outputs appear in the form SAMPLE OUTPUT.
d. All hexadecimal numbers appear in the form AF6.
Which statement is false?
a) Every block is a compound statement.
b) Every compound statement is a block.
c) Blocks can be nested.
d) Compound statements can be nested.
page-pf6
The symbolic constant __________ indicates that the file position pointer is to be
positioned relative to the beginning of the file by the amount of the offset.
a) SEEK_SET
b) SEEK_BEGIN
c) SEEK_START
d) SEEK_CUR
Q3: The __________ operator returns a reference to a __________ object:
a. typeid, type_info
b. typeinfo, type_id
c. typeid, data_type
d. typeinfo, type
page-pf7
Every #if construct
a) must end with #end.
b) always affects code throughout the entire body of the program.
c) is used for debugging.
d) must end with #endif.
Which statement is generally false?
a) Statements preceding a for and statements in the body of a for should typically be
merged into the for header.
b) Limit the size of control statement headers to a single line, if possible.
c) Initialization of a for loop control variable can occur before the for loop executes and
not in the loop itself.
d) The increment portion of a for header can be a decrement.
The program segment
int counter = 1;
page-pf8
do {
printf("%i ", counter);
} while (++counter <= 10);
will ________.
(a) print the numbers 1 through 11
(b) print the numbers 1 through 10
(c) print the numbers 1 through 9
(d) cause a syntax error

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.