COSC 15987

subject Type Homework Help
subject Pages 9
subject Words 1569
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
Which of the following is a function that reads a specified number of bytes from a file
into memory?
(a) fseek
(b) fwrite
(c) fread
(d) fopen
Which statement is false?
a) Bit field manipulations are machine dependent.
b) Bit fields may never cross a word boundary.
c) Bit fields are not "arrays of bits."
d) It is not possible to take the address of a bit field.
Q6: Which of the following is not a disadvantage of default memberwise copy with
objects containing pointers?
a. Having the possibility of leaving a dangling pointer.
b. Allowing both objects to point to the same dynamically allocated storage.
page-pf2
c. Allowing the destructor of one object to be called while leaving the second pointer, to
the same memory location, intact.
d. Requiring the explicit overloading of the assignment operator.
A pointer cannot be assigned to
(a) another pointer of the same type
(b) a pointer to void
(c) a pointer of a type other than its own type and void
(d) any other pointer by using the cast operator
Which statement is true?
a) Sentinel values are used to control iteration when the precise number of iterations is
known in advance.
b) In a counter controlled-loop, the counter may not count downward.
c) Sentinels must be distinct from regular data items.
d) Sentinel-controlled iteration is often called definite iteration.
page-pf3
.3 Q3: Which of the following classes is deepest in the inheritance hierarchy?
a. basic_iostream
b. basic_ofstream
c. basic_ifstream
d. basic_fstream
Which of the following statements is false?
a) The primary functions used to manipulate a stack are push and pop.
b) Function pop removes a node from the bottom of the stack.
c) Function push creates a new node and places it on top of the stack.
d) A stack can be implemented as a constrained version of a linked list by allowing
insertions and deletions only at one end of the linked list.
page-pf4
An identifier's storage class
(a) determines the period during which that identifier exists in memory
(b) determines whether an identifier in a multiple-source-file program is known only in
the current source file or in any source file with proper definitions
(c) determines where the identifier can be referenced in a program
(d) all of the above
Add the following nodes to a binary search tree in the order they appear.
6 34 17 19 16 10 23 3
What is the output of a postorder traversal of this tree?
(a) 3 10 16 23 19 17 34 6
(b) 3 6 17 16 10 19 23
(c) 6 3 34 17 16 10 19 23
(d) 10 16 23 19 17 34 3 6
page-pf5
The integral type of the value returned by operator sizeof is __________.
a) size-t
b) sizet
c) size.t
d) size_t
Which of the following is not a standard C formatted stream?
(a) standard input stream
(b) standard error stream
(c) standard output stream
(d) standard redirection stream
The C compiler ignores __________ characters like blanks, tabs and newlines used for
indentation and vertical spacing.
a) transparent
b) translucent
page-pf6
c) white
d) whitespace
The order in which statements are __________ is called flow of control.
a) entered in a source file
b) preprocessed
c) compiled
d) executed
A computer can directly understand only its own ___________.
(a) machine language
(b) assembly language
(c) high-level language
(d) none of the above
page-pf7
Which statement is true?
a) strtok modifies the input string.
b) strtok makes a backup copy of the input string.
c) The first argument of each call to strtok is the string being tokenized.
d) strtok works only with a set of four predefined delimiters.
Q2: The difference between the operator! member function and the operator void*
member function is that:
a. They always return opposite boolean values.
b. They occasionally return opposite boolean values.
c. Of the two member functions, only operator! checks if eof has been set.
d. Of the two member functions, only operator void* checks if eof has been set.
page-pf8
When a structure must be passed to a function, we can use pointers to constant data to
get the performance of a call by __________ and the protection of a call by
__________.
a) value, value
b) value, reference
c) reference, value
d) reference, reference
Q1: Which of the following is most likely a base class of the other three?
a. automobile.
b. convertible.
c. miniVan.
d. sedan.
Q1: Which of the following statements about the C++ Standard Library is false:
a.The C++ Standard Library consists of classes and functions that perform tasks.
b.The C++ Standard Library is an important part of the C++ "world."
page-pf9
c.An advantage of using classes and functions from the C++ Standard Library is saving
the effort of designing, developing and testing new classes.
d.The C++ Standard Library functions and classes are not included in every C++
implementation.
Which initialization is not performed by the following definition?
int b[2][2] = {{1}, {3, 4}};
a)b[0][0] is set to 1
b) b[0][1] is set to 1
c) b[1][0] is set to 3
d) b[1][1] is set to 4
________ are used for permanent retention of large amounts of data.
(a) Structures
(b) Arrays
(c) Records
page-pfa
(d) Files
Which of the following is a function that causes a program's file position pointer to be
repositioned to the beginning of the file?
(a) rescan
(b) rewind
(c) return
(d) none of these
Labels are the only identifiers with
(a) function scope
(b) file scope
(c) block scope
(d) function-prototype scope
page-pfb
. An array of structures is automatically passed __________.
a) by value
b) by reference
c) by aggregate
d) by enumeration
Q1: Which of the following is a valid user-defined output stream manipulator header?
a. ostream& tab( ostream& output )
b. ostream tab( ostream output )
c. istream& tab( istream output )
d. void tab( ostream& output )
page-pfc
Which of the following statements is true?
(a) The size of a struct variable is the sum of its members' sizes.
(b) struct variables can be compared for equality or inequality.
(c) In a struct variable, undefined extra bytes could contain secure dataleft over from
prior use of those memory locationsthat should not be accessible.
(d)None of the above.
Which is not a storage class?
a) automatic
b) register
c) extern
d) static
The __________ flowchart symbol is also called the action symbol.
a) small circle
b) diamond
page-pfd
c) rounded rectangle
d) rectangle
Q2: Select the false statement. The new operator:
a. Can attempt to allocate as much memory as the programmer requests.
b. Returns a pointer to a location in memory.
c. Can indicate failure differently on different compilers.
d. Throws a bad_alloc exception regardless of what function is registered with
set_new_handler.
Q2: An error occurs if:
a. A non-reference, non-const, primitive data member is initialized in the member
initialization list.
b. An object data member is not initialized in the member initialization list.
c. An object data member does not have a default constructor.
d. An object data member is not initialized in the member initialization list and does not
have a default constructor.
page-pfe
A ________ is an electronic collection of data that's organized for easy access and
manipulation.
(a) field
(b) database
(c) record
(d) file
Q1: Which of the following is false about the new operator and the object for which it
allocates memory?
a. It calls the object's constructor.
b. It returns a pointer.
c. It does not require the size of the object to be explicitly specified in the new
expression.
d. It automatically destroys the object after mainis exited.
page-pff
Which statement about the bubble sort is false?
a) It is easy to program.
b) It is a high-performance sort.
c) It compares only adjacent elements with one another.
d) The bubble sort compares successive pairs of elements.

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.