CDA 60589

subject Type Homework Help
subject Pages 10
subject Words 1529
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 include statement is usually appropriate for user-defined files?
(a) include <filename>
(b) #include "filename"
(c) Both (a) and (b) are appropriate.
(d) Neither (a) nor (b) is appropriate.
All of the following are true of functions except:
(a) they define specific tasks that can be used at many points in a program
(b) a function call must specify the name and arguments of the function
(c) the definition of a function is always visible to other functions
(d) the implementation of a function is hidden from the caller
The binary search technique
(a) is better suited to small arrays
(b) is better suited to unsorted arrays
(c) can only be used on a sorted array
page-pf2
(d) is slower than a linear search
Q2: What is the default initial value of a String?
a. ""
b. "default"
c. default
d. None of the above.
Q1: Today, virtually all new major operating systems are written in:
a.B or BCPL.
b.C or C++.
c.UNIX.
d.Smalltalk.
page-pf3
The linker creates __________.
(a) an executable image
(b) a preprocessor directive
(c) object code
(d) an input stream
The isxdigit (is hex digit) function would return false on
(a) a
(b) A
(c) 2
(d) g
page-pf4
Placing a semicolon after the right parenthesis enclosing the parameter list of a function
definition is a __________ error.
a) logic
b) syntax
c) fatal runtime
d) nonfatal runtime
Which of the following would not be considered hardware?
(a) an operating system
(b) a CPU
(c) a keyboard
(d) a disk
The preprocessor directive
#error 7 " Out of range error "
contains __________ tokens.
page-pf5
a) 8
b) 7
c) 9
d) 6
The type of a parameter whose type is omitted in a function definition is __________.
a) int
b) double
c) long
d) float
Which of the following statements is true?
a) A structure's size is sometimes smaller than the total of the sizes of its members.
b) A structure's size is always larger than the total of the sizes of its members.
c) A structure's size is not necessarily the sum of the sizes of its members.
d) A structure's size is the sum of the sizes of its members.
page-pf6
Which statement is false?
a) The compiler uses function prototypes to validate function calls.
b) Prior to ANSI C, C did not include function prototypes.
c) A function prototype tells the compiler the type of data returned by the function, the
number of parameters the function expects to receive, the types of these parameters and
the order in which parameters of these types are expected.
d) The designers of ANSI C++ borrowed the notion of function prototypes from the
developers of C.
The __________ is the value that occurs most frequently in the data.
a) mean
b) median
c) mode
d) master
page-pf7
How many types of control statements exist in C?
(a) 3
(b) 7
(c) 5
(d) 2
Q2: Because the postfix increment operator returns objects by value and the prefix
increment operator returns objects by reference:
a. Prefix increment has slightly more overhead than postfix increment.
b. The postfix increment operator returns the actual incremented object with its new
value.
c. Objects returned by postfix increment cannot be used in larger expressions.
d. The postfix increment operator typically returns a temporary object that contains the
original value of the object before the increment occurred.
page-pf8
Consider the following code, assuming that x is an integer variable with an initial value
of 12:
if (x = 6) {
printf("%i", x);
}
What is the output?
(a) 6
(b) 12
(c) nothing
(d) a syntax error is produced
When exit is called with EXIT_FAILURE
(a) the program quits immediately without returning anything
(b) the program prints an error message and quits the current function
(c) the implementation-defined value for unsuccessful termination is returned
(d) the program breaks out of a loop
page-pf9
Which of the following function prototypes is correct?
(a) double average(int, ...)
(b) double average(..., int);
(c) double average(int, ...);
(d) double average(int, ... , int);
Q1: One difference between the three-argument version of the get function and the
getline function is that:
a. Only get has a delimiter.
b. The getline function removes the delimiter from the stream.
c. Only get adds the delimiter to the array.
d. getline stores the characters it reads into its character array argument.
Q4: Abstract classes do not necessarily have:
a. A 0 pointer in their vtable.
page-pfa
b. A virtual function prototype with the notation = 0.
c. Zero instances of their class.
d. Zero references to their class.
Which of the following is not a flag that can be used in the printf format-control string?
(a) 0
(b) +
(c) /
(d) #
Which statement about the preprocessor is false?
a) it can perform conditional compilation of program code
b) it can perform conditional execution of preprocessor directives
c) all preprocessor directives begin with #
d) all preprocessor directives must end in a semicolon.
page-pfb
A self-referential structure contains a ________ member that points to ________.
(a) integer, a structure of the same structure type
(b) pointer, an integer
(c) integer, an integer
(d) pointer, a structure of the same structure type
Which of the following is not an escape sequence?
(a) \a
(b) \b
(c) \c
(d) none of these
page-pfc
Q1: The good member function will return false if:
a. The eof member function would return true.
b. The bad member function would return true.
c. The failbit member function would return true.
d. Any of the above.
In the expression
n = a + rand() % b;
(a) b is the shifting value
(b) a is the scaling value
(c) b is equal to the width of the desired range of integers
(d) both (a) and (c)
Small circle symbols in a flowchart are often called __________ symbols.
a) little circle
b) collision
page-pfd
c) connector
d) collator
Conversion specifier c requires a(n) __________ argument.
a) pointer to char
b) char
c) integer
d) ASCII numeric
Conversion specifiers e and E always print exactly __________ to the left of the
decimal point.
a) zero digits
b) one digit
c) two digits
d) three digits
page-pfe
Which of the following is the correct way to output the value of 4 left justified?
(a) printf( "%i", 4 );
(b) printf( "%-i", 4 );
(c) printf( "4%i", 4 );
(d) printf( "4-%i", 4 );
A pipe (|) causes
(a) the output of the first program to be redirected to the input of the second
(b) the output of the second program to be redirected to the input of the first
(c) the input of the first program to be redirected to the input of the second
(d) the input of the second program to be redirected to the input of the first
page-pff
A fatal logic error is always caused by:
(a) not initializing variables before executing an iteration statement
(b) choosing a sentinel value that is also a data value
(c) using a counter variable in a calculation after the loop
(d) an attempt to divide by zero
Q3: Which of the following lines would be the prototype for an overloaded cast
operator function that converts an object of user-defined type Time into a double?
a. Time::operator double() const;
b. Time::static_cast double() const;
c. Time::operator_cast(double) const;
d. Time::double() const;
Q2: Once an exception is thrown, when can control return to the throw point?
a. Never.
b. Only after the exception is caught.
page-pf10
c. Once the stack unwinding process is completed.
d. Immediately after the exception is thrown.

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.