CICS 48671

subject Type Homework Help
subject Pages 12
subject Words 994
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
Q3: A copy constructor:
a. Is a constructor with only default arguments.
b. Is a constructor that initializes a newly declared object to the value of an existing
object of the same class.
c. Is a constructor that takes no arguments.
d. None of the above.
Which function would be the most useful for determining if a certain word is contained
in a string representing a sentence?
(a) strcspn
(b) strchr
(c) strstr
(d) strrchr
The floating-point conversion specifiers e and E display floating-point values in
__________ notation.
a) elliptical
page-pf2
b) existential
c) exponential
d) exportable
Of the following, which is not a logic error?
(a) Using the assignment (=) operator instead of the (==) equality operator to determine
if two values are equal
(b) Dividing by zero
(c) Failing to initialize counter and total variables before the body of a loop
(d) Using commas instead of the two required semicolons in a for header
Q2: Which of the following is not a good example of a hierarchy likely to be modeled
by inheritance?
a. Airplanes.
b. Geometric shapes.
c. Animals.
page-pf3
d. Prime numbers.
Select the incorrect statement. Binary trees (regardless of the order in which the values
are inserted into the tree)
(a) always have multiple links per node.
(b) can be sorted efficiently.
(c) always have the same shape for a particular set of data.
(d) are nonlinear data structures.
Q1: Conversion constructors:
a. Can have multiple arguments.
b. Can convert between user-defined types.
c. Are implicitly defined by the compiler if not explicitly written by the programmer.
d. Cannot convert built-in types to user defined types.
page-pf4
Q1: The type of function a client would use to check the balance of a bank account
would be:
a. A utility function.
b. A predicate function.
c. An access function.
d. A constructor.
Which one item is most different from the other three?
a) worker function
b) caller
c) calling function
d) boss function
page-pf5
srand
(a) should be called before each call to rand
(b) should be used instead of rand to generate truly random numbers
(c) is unnecessary in C
(d) can use timeas an automatically input seed value
Q1: If a function's program logic and operations are identical for each data type it could
receive as argument(s) then a __________ should be used.
a. Overloaded function.
b. Recursive function.
c. Macro.
d. Function template.
Which statement about the level-order traversal of a binary tree is false?
a) It visits the nodes of a tree row by row.
b) The search begins at the root node.
page-pf6
c) The search begins at the row of the leftmost leaf node.
d) On each level of the tree, the nodes are visited left to right.
Which is not a part of a format control string?
a) conversion specifiers
b) flags
c) field widths
d) printf
The %g conversion specifier indicates ________.
(a) color
(b) significant digits
(c) a global variable
(d) a hexadecimal integer
page-pf7
Q1: Which of the following classes is a base class of the other three?
a. basic_ios
b. basic_istream
c. basic_ostream
d. basic_iostream
A correct decision symbol has __________ flowlines emerging from it.
a) 4
b) 3
c) 2
d) 1
page-pf8
Using standard library functions can be more efficient because __________.
(a) they save programming time
(b) they are carefully written to perform optimally
(c) they increase program portability
(d) all of the above.
Q3: When a client code programmer uses a class whose implementation is in a separate
file from its interface, that implementation code is merged with the client's code during
the:
a. Programming phase.
b. Compiling phase.
c. Linking phase.
d. Executing phase.
Which of the following will not generate a signal defined in the header signal.h?
(a) a call to exit
(b) dividing by zero
page-pf9
(c) a call to abort
(d) an invalid access to storage
The __________ selection statement performs one of many different actions, depending
on the value of an expression.
a) if
b) when
c) ifelse
d) switch
Q1: What is the name of the values the method call passes to the method for the
parameters?
a. Arguments.
b. References.
c. Objects.
d. Values.
page-pfa
Which operator sets the bits in the result to 1 if at least one of the corresponding bits in
the two operands is 1?
a) bitwise AND
b) bitwise inclusive OR
c) bitwise exclusive OR
d) bitwise complement
Which of the following is false?
(a) Data can be inserted in a randomly accessed file without destroying other data in the
file.
(b) There is more than one way to implement randomly accessed files.
(c) Randomly accessed files cannot be accessed directly without searching through
other records.
(d) Data stored previously can be updated or deleted without rewriting the entire file.
page-pfb
Q1: What will be output by the following statements?
double x = 1.23456789;
cout << fixed;
cout << setprecision(5) << x << endl;
cout.precision(3);
cout << x << endl;
cout << x << endl;
a. 1.2346
1.23
1.23
b. 1.23457
1.235
1.23456789
c. 1.2346
1.23
1.23456789
d. 1.23457
1.235
1.235
page-pfc
Structures may be passed to functions by ________.
(a) passing individual structure members
(b) passing an entire structure
(c) passing a pointer to the structure
(d) all of these
Which statement is true?
a) Each of C's control statements is characterized as being single-entry, single-exit.
b) Each of C's control statements is characterized as being single-entry, multiple-exit.
c) Each of C's control statements is characterized as being multiple-entry, single-exit.
d) Each of C's control statements is characterized as being multiple-entry, multiple-exit.
In 1.504582E+02, the E+02 indicates that __________.
a) 1.504582 is to be raised to the second power
b) 1.504582 is to be extended by two print positions
page-pfd
c) 1.504582 is to be multiplied by 100
d) 1.504582 is to be doubled
Q1: If the line:
friend class A;
appears in class B, and the line:
friend class B;
appears in class C, then:
a. Class A is a friend of class C.
b. Class A can access private variables of class B.
c. Class C can call class A's private member functions.
d. Class B can access class A's private variables.
Which of the following statements should be used in secure C programming to display
the string "Welcome" not followed by a newline character?
(a) printf( "Welcome" );
page-pfe
(b) puts( "Welcome" );
(c) printf( "%s", "Welcome" );
(d) None of the above.
Which statement is false?
a) C automatically passes arrays to functions using simulated call by reference.
b) When C passes an array to a function, the called function normally can modify the
element values in the caller's original array.
c) The name of an array is actually the address of the first element of the array.
d) When an array is passed in a function call, the calling function knows precisely
where in the called function's memory the passed array is.
Programs or data not actively being used by the other units are placed on the
__________.
(a) output unit.
(b) memory unit.
(c) secondary storage unit.
page-pff
(d) central processing unit.
Q2: A client changing the values of private data members is:
a. Only possible by calling private member functions.
b. Possible using public functions and references.
c. Never possible.
d. Only possible if the private variables are not declared inside the class.
The preprocessor directive
#line 200
a) numbers the first 200 lines of a source-code program from 1 to 200.
b) numbers the first 200 lines of a source-code program from 0 to 199.
c) starts line numbering from 200 beginning with the next source-code line
d) numbers the next line 200 and has no effect on other lines.
page-pf10
Q1: There exists a data type Date with member function Increment that increments the
current Date object by one. The ++ operator is being overloaded to postincrement an
object of type Date. Select the correct implementation:
a. Date Date::operator++( int )
{
Date temp = *this;
Increment();
return *temp;
}
b. Date Date::operator++( int )
{
Increment();
Date temp = *this;
return temp;
}
c. Date Date::operator++( int )
{
Date temp = *this;
return this;
temp.Increment();
}
d. Date Date::operator++( int )
page-pf11
{
Date temp = *this;
Increment();
return temp;
}
Which of the following statements about stacks is incorrect?
(a) stacks can be implemented using linked lists.
(b) stacks are first in, first-out (FIFO) data structures.
(c) new nodes can only be added to the top of the stack.
(d) the last node (the bottom) of a stack has a null (zero) link.
page-pf12
Q1: Which of the following statements will not produce a syntax error?
a. Defining a const member function that modifies a data member of the object.
b. Invoking a non-const member function on a const object.
c. Declaring an object to be const.
d. Declaring a constructor to be const.

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.