CAPP 51387

subject Type Homework Help
subject Pages 9
subject Words 1132
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
How many pointers are contained in a circular, doubly linked list with five nodes?
(a) 5
(b) 8
(c) 15
(d) 10
Which statement about the #include directive is false?
a) The difference between the various forms of the #include directive is the location the
preprocessor searches for the file to be included.
b) If the file name is enclosed in quotes, the preprocessor searches in the same directory
as the file being compiled for the file to be included.
c) If the file name is enclosed in angle brackets, the preprocessor searches in the same
directory as the file being compiled for the file to be included.
d) The preprocessor searches for standard library header files in an
implementation-dependent manner.
Which statement is true?
a) The file position pointer is a pointer to a FILE structure.
page-pf2
b) The file position pointer is a pointer to an FCB.
c) The file position pointer is not really a pointer.
d) The file position pointer specifies the file reset.
The __________, or address operator, is a unary operator that returns the address of its
operand.
a) &
b) &&
c) *
d) **
Which statement is true?
a) Entire arrays are passed simulated call by reference and individual array elements are
normally passed simulated call by reference.
b) Entire arrays are passed simulated call by reference and individual array elements are
normally passed call by value.
c) Entire arrays are passed call by value and individual array elements are normally
page-pf3
passed simulated call by reference.
d) Entire arrays are passed call by value and individual array elements are normally
passed call by value.
Q2: A(n) ________ enables a program to read data from the user.
a.std::cout.
b.std::cin.
c.return statement.
d.main declaration.
Q1: An advantage of using inheritance with exceptions is:
a. The ability to catchrelated errors easily.
b. Allowing catch statements to be imported into classes.
c. The ability to explicitly test for derived class objects individually.
d. The simplification of destructor calls for objects.
page-pf4
Which of these is not a common programming error?
a) Referring to memory that has been freed.
b) Freeing memory (with free) that was not dynamically allocated.
c) Assuming that the size of a structure is simply the sum of the sizes of its members.
d) Calling malloc in a statement without using sizeof.
Which is a correct form of the #include directive
a) #include "filename"
b) #include /filename/
c) #include #filename
d) #include <filename>
page-pf5
Which statement is false about multidimensional arrays?
a) C supports multidimensional arrays.
b) A common use of multidimensional arrays is to arrange data into tables consisting of
rows and columns.
c) To identify a particular table element requires two indices.
d) Every ANSI C system can support arrays with as many indices as the programmer
chooses.
If array name arrayName is passed to a function, C automatically passes __________.
a) &arrayName[0]
b) arrayName[1]
c) arrayName[0]
d) *arrayName
Function fgets appends a __________ to its array target in memory.
a) leading null character
b) leading end-of-file character
page-pf6
c) terminating null character
d) terminating end-of-file character
Q3: In the UML, the top compartment of the rectangle modeling a class contains:
a. The class's name.
b. The class's attributes.
c. The class's behaviors.
d. All of the above.
Q1: Which of the following operators can be overloaded as a non-member function?
a. ()
b. []
c. +=
d. ==
page-pf7
When calling a function with arguments that should be modified, the __________ of
those arguments are passed.
a) memory
b) addresses
c) values
d) complements
Function __________ compares up to n characters of its first argument with its second
argument.
a) nstrcmp
b) strncmp
c) strcmpn
d) strcmp
page-pf8
Q2: The delete [] operator:
a. Can terminate the program.
b. Must be told which destructor to call when destroying an object.
c. Can delete an entire array of objects declared using new.
d. Is called implicitly at the end of a program.
Which of the following is not an error?
(a) having a function definition that spans two files
(b) using a global variable in a file it was not defined in without defining it with the
extern modifier
(c) defining a function prototype without the extern keyword when the definition is in
another file
(d) having global variables in different files with the same name
Which software product release category is "generally feature complete and supposedly
bug free, and ready for use by the community?"
page-pf9
(a) Alpha.
(b) Beta.
(c) Release candidate.
(d) Continuous beta.
When the computer compares two strings, it actually compares the __________ in the
strings.
a) number of characters
b) numeric codes of the characters
c) character bits
d) lengths of the leading alphabetic portions
Every function of the string handling library except for __________ appends the null
character to its result.
a) strncpy
b) strncat
page-pfa
c) strcpy
d) strcat
Referencing elements outside the array bounds
(a) can result in changes to the value of an unrelated variable
(b) is impossible because C checks to make sure it does not happen
(c) is a syntax error
(d) enlarges the size of the array
An algorithm that could execute for an unknown amount of time because it depends on
random numbers to exit a function may
(a) have a redundancy.
(b) get caught in an infinite loop.
(c) suffer from indefinite postponement.
(d) issue a compiler error.
page-pfb
Q1: A default constructor:
a. Is a constructor that must receive no arguments.
b. Is the constructor generated by the compiler when no constructor is provided by the
programmer.
c. Does not perform any initialization.
d. Both (a) and (b).
Q2: Given the class definition:
class CreateDestroy
{
public:
CreateDestroy() { cout << "constructor called, "; }
~CreateDestroy() { cout << "destructor called, "; }
};
What will the following program output?
int main()
{
page-pfc
for ( int i = 1; i <= 2; ++i )
CreateDestroy cd;
return 0;
}
a. constructor called, destructor called, constructor called, destructor called,
b. constructor called, constructor called,
c. constructor called, constructor called, destructor called, destructor called,
d. Nothing.
Which statement is false?
a) It is not correct to split an identifier with a space, a tab or a newline.
b) Statements and comments may be split over several lines.
c) The equals sign (=) is not an operator.
d) A good programming practice is to break a line after a comma in a lengthy
comma-separated list.
page-pfd
Q3: Which of the following is a variable declaration statement?
a.int total;
b.#include <iostream>
c.int main()
d.// first string entered by user
Which of the following is not one of the three general types of computer languages?
(a) Machine languages.
(b) Assembly languages.
(c) High-Level languages.
(d) Spoken languages.
Comparing pointers and performing arithmetic on them is meaningless unless
(a) they point to members of the same array
(b) they point to arrays of the same type
(c) they point to arrays of equal size
page-pfe
(d) they point to different locations
Suppose a program contains the code
for (i = 1; i < = 10; i++) {
n[i] = 0;
}
Which statement about this code must be true?
a) It contains an off-by-one error.
b) It contains a syntax error.
c) It is initializing the first 10 elements of an array.
d) It is initializing successive elements of an array.
What is the value of fabs(-5.)?
a) 5
b) 5.
page-pff
c) -5
d) "5.
When arguments are passed by __________, the caller allows the called function to
modify the original variable's value.
(a) value
(b) reference
(c) both a and b
(d) none of these

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.