CDA 96351

subject Type Homework Help
subject Pages 10
subject Words 1791
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
Evaluate the expression
3 * 4 % 6 + 4 * 5
(a) 20
(b) 26
(c) 12
(d) 32
The ________ character reads data from the input stream and discards the data.
(a) %
(b) conversion specifier
(c) assignment suppression
(d) //
Q3: Which of the following statements about virtual functions is false?
a. They allow the program to select the correct implementation at execution time.
b. They can use either static or dynamic binding, depending on the handles on which
page-pf2
the functions are called.
c. They do not remain virtual down the inheritance hierarchy.
d. They can be called using the dot operator.
Q1: Select the false statement regarding inheritance.
a. A derived class can contain more attributes and behaviors than its base class.
b. A derived class can be the base class for other derived classes.
c. Some derived classes can have multiple base classes.
d. Base classes are usually more specific than derived classes.
Place __________ before any integer conversion specifier to indicate that a short
integer is to be displayed.
a) s
b) S
c) h
d) H
page-pf3
A function that prints a string should have a parameter that's a
(a) nonconstant pointer to nonconstant data.
(b) nonconstant pointer to constant data.
(c) constant pointer to nonconstant data.
(d) constant pointer to constant data.
Unless otherwise specified, entire arrays are passed __________ and individual array
elements are passed __________.
(a) call-by-value, call-by-reference
(b) call-by-reference, call-by-value
(c) call-by-value, call-by-value
(d) call-by-reference, call-by-reference
page-pf4
Which statement about C arithmetic is false?
a) 6 / 3 yields 2
b) 5 / 2 yields 2.
c) 7 % 3 yields 1
d) 6 % 3 yields 0
. If there are fewer __________ in the list than members in the structure, the remaining
members are automatically initialized to 0 or NULL.
a) quantifiers
b) initializers
c) numerators
d) variables
__________ are important in compilers and operating systemsinsertions and deletions
are made only at one end of a __________its top.
a) Linked lists, linked list
page-pf5
b) Queues, queue
c) Stacks, stack
d) Binary trees, binary tree
Which statement is false?
a) Function strerror takes an error number and creates an error message string.
b) Function strerror maps its integer argument into a full text string in a
system-dependent manner
c) Function strlen determines the length of a string including the null character.
d) Function strerror does not display its string output.
Q2: The code fragment:
Increment::Increment( int c, int i )
: increment ( i )
{
count = c;
page-pf6
}
does not cause any compilation errors. This tells you that:
a. count must be a non-const variable.
b. count must be a const variable.
c. increment must be a non-const variable.
d. increment must be a const variable.
Which statement is false?
a) The programmer must provide any file structure to meet the requirements of each
particular application.
b) A programmer can impose a record structure on a file.
c) Records must be written to a C file in order by record key.
d) The notion of a record of a file does not exist in C.
Q3[C++11]: Which of the following statements about inheriting base class constructors
is false?
page-pf7
a. To inherit a base class's constructors, you write the following line of code in the
derived class definition (BaseClass is the base class's name):
using BaseClass::BaseClass;
b. If an inherited base-class constructor has default arguments, the line of code in Part
(a) causes the compiler to generate a derived-class constructor with the same default
arguments.
c. By default, each inherited constructor has the same access level (public, protected or
private) as its corresponding base-class constructor.
d. If the derived class does not explicitly define constructors, the compiler generates a
default constructor in the derived classeven if it inherits other constructors from its base
class.
Which is not an ANSI standard library function?
a) printf
b) main
c) scanf
d) pow
page-pf8
Which language was developed by Microsoft for integrating the Internet and the web
into computer applications?
(a) Objective-C.
(b) Java.
(c) PHP.
(d) Visual C#.
Q3: The is-a relationship represents.
a. Composition.
b. Inheritance.
c. Information Hiding.
d. A friend.
Which of the following encompasses the other three?
(a) sequence structure
page-pf9
(b) iteration structure
(c) control structure
(d) selection structure
If a file is not closed explicitly by a program __________.
a) the operating system normally will close the file when program execution terminates
b) the file will be left open when the program terminates, creating a possible security
breach
c) the operating system will query the user to determine if he or she wishes to close the
file when the program terminates
d) the operating system will not allow the owner of that program to run any other
programs
Q3: The compiler will implicitly create a default constructor if:
a. The class does not contain any data members.
b. The programmer specifically requests that the compiler do so.
c. The class does not define any constructors.
page-pfa
d. The class already defines a default constructor.
The most concise notation to use to define function parameters x and y as double is
__________.
a) x, y
b) x, double y
c) double x, y
d) double x, double y
The comma operator is most often used in __________ statements.
a) while
b) do while
c) for
d) switch
page-pfb
Q5: An exception:
a. Terminates program execution.
b. Terminates the block where the exception occurred.
c. Will terminate the block where the exception occurred unless a catch command stops
it.
d. Will not terminate a block unless explicitly instructed to do so.
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 an array
page-pfc
Function strcspn returns __________.
a) a length
b) a range of characters
c) the starting and ending positions of a range of characters
d) a char
Which character-handling library function converts lowercase letters to uppercase
letters?
a) lowertoupper
b) isupper
c) touppercase
d) toupper
In C, the condition 4 > y > 1
(a) evaluates correctly
(b) does not evaluate correctly and should be replaced by (4 > y && y > 1)
page-pfd
(c) does not evaluate correctly and should be replaced by (4 > y & y > 1)
(d) does not evaluate correctly and should be replaced by (4 > y || y > 1)
Which of the following statements about binary search trees is false?
a) The binary search tree facilitates duplicate elimination.
b) In a tightly packed binary search tree, each level contains about half as many
elements as the previous level. (The previous level is the level closer to the root node.)
c) When searching a tightly packed billion-element search tree, only about 30 elements
(or fewer) are required to locate most elements.
d) When searching a tightly packed million-element search tree, only about 20 elements
(or fewer) are required to locate most elements.
Q2: Which statement about class unique_ptr (of the new C++ standard) and dynamic
memory allocation is false?
a. An object of class unique_ptr maintains a pointer to dynamically allocated memory.
b. When a unique_ptr object destructor is called (for example, when a unique_ptr object
goes out of scope), it performs a destroy operation on its pointer data member.
c. Class template unique_ptr provides overloaded operators * and -> so that a
unique_ptr object can be used just as a regular pointer variable is.
page-pfe
d. Class unique_ptr is part of the new C++ standard and it replaces the deprecated
auto_ptr class.
. Which of the following is false?
a) Structure member names throughout a program must be unique.
b) Attempting to refer to a member of a structure by using only the member's name is an
error.
c) Inserting a space between the - and > of operator -> is an error.
d) The dot operator (.) is the structure member operator.
Which statement is true?
a) Operator || has a higher precedence than operator &&.
b) In expressions involving operator ||, making the condition that is most likely to be
false the leftmost condition can often reduce execution time.
c) The logical negation operator is a binary operator.
page-pff
d) In expressions using operator &&, making the condition that is most likely to be
false the leftmost condition can often reduce execution time.
As used in
int square(int);
int is not a(n) __________.
a) data type
b) parameter type
c) return type
d) function prototype
Q1: In regards to default arguments, which of the following is false?
a. When an argument is omitted in a function call, the default value of that argument is
automatically inserted by the compiler and passed in the function call.
b. They must be the rightmost (trailing) arguments in a function's parameter list.
c. Default values can be constants.
d. Default values cannot be global variables or function calls.

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.