CICS 72965

subject Type Homework Help
subject Pages 10
subject Words 371
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 statement about scan sets is false?
a) A scan set is a set of characters enclosed in parentheses and preceded by a percent
sign in the format control string.
b) A scan set scans the characters in the input stream looking only for those characters
that match the characters contained in the scan set.
c) Each time a character in the input stream matches a character in the scan set, the
input stream character is stored in the scan set's corresponding argumenta pointer to a
character array.
d) The scan set stops inputting characters when a character that is not contained in the
scan set is encountered.
Strings can not
(a) be initialized using string literals
(b) end in a character other than the null character
(c) be initialized with initializer lists
(d) be treated as arrays of characters
Q1: The relationship between function templates and function-template specializations
is most similar to the relationship between:
page-pf2
a. Classes and objects.
b. Classes and functions.
c. Functions and return types.
d. Headers and source files.
Which statement is true?
a) EOF must have the value 1 on all C systems.
b) EOF is a symbolic constant defined in the <symbol.h> header file.
c) EOF is a symbolic variable defined in the <stdio.h> header file.
d) EOF is a symbolic integer constant defined in the <stdio.h> header file.
Which of the following is not true of queues?
a) Network packets wait in queues for service at routers .
b) The entry at the front (or head) of the queue is the next to be removed.
c) Queues are used to support print spooling.
page-pf3
d) Queues are used to support high-speed sorting algorithms.
Function strcmp returns __________ if its first argument is equal to its second
argument.
a) specifically 1
b) any non-zero value (i.e., true)
c) specifically 0
d) any negative value
Q1: Which of the following prints the address of character string string given the
following declaration?
char * string = "test";
a. cout << string;
b. cout << *&string;
c. cout << static_cast< void * >( string );
d. cout << * string;
page-pf4
The pair of braces that delineate the body of main and the portion of the program
between these braces is called a __________.
a) function
b) block
c) statement
d) header
Q3[C++11]: Which of the following statements about a unique_ptr object is true?
a. A unique_ptr is a 'smart pointer" for managing dynamically allocated memory.
b. When a unique_ptr goes out of scope, its destructor automatically returns the
managed memory to the free store.
c. You must explicitly delete the memory that's managed by a unique_ptr before the
object goes out of scope.
d. All of the above.
page-pf5
Which of the following is not a synonym for a C string?
a) message
b) character string
c) character
d) literal
Which statement is false?
a) The string termination character is called the null character.
b) The string 'string" actually occupies 7 characters in memory.
c) The character representation of the last character in memory of a string is "\0".
d) A character array representing a string should be defined as large as the actual
number of characters in the string minus the terminating character; C automatically
provides the space for the terminating character.
page-pf6
Which of the following is an iteration statement?
(a) if
(b) ifelse
(c) dowhile
(d) switch
realloc is conventionally used to
(a) allocate memory for a single object
(b) allocate memory for an array of objects
(c) change the size of an object previously allocated
(d) change the contents of an object previously allocated
The rewind statement causes __________.
a) the disk to stop spinning, then spin in reverse until it repositions to the beginning of
the file.
b) the contents of the file to be erased.
page-pf7
c) a program's file position pointer to be repositioned to the beginning of the file (i.e.,
byte 0).
d) a file to be closed and then re-opened.
Q1: virtual destructors must be used when:
a. The constructor in the base class is virtual.
b. delete is used on a base-class pointer to a derived-class object.
c. delete is used on a derived-class object.
d. A constructor in either the base class or derived class is virtual.
What is bandwidth?
(a) information carrying capacity
(b) response time
(c) the set of networking protocols
(d) an error-control technique
page-pf8
SIGFPE signals
(a) an erroneous arithmetic operation
(b) the abnormal termination of the program
(c) the detection of an illegal instruction
(d) an invalid access to storage
What is the significance of the 1 in the following statement?
fwrite(&number, sizeof(int), 1, fPtr);
(a) It specifies that the file is to be opened for updating.
(b) It specifies the number of elements in the array that should be written to disk.
(c) It specifies the byte size of the element being written to disk
(d) none of these
page-pf9
Q1: When the showbase flag is set:
a. The base of a number precedes it in brackets.
b. Decimal numbers are not output any differently.
c. "oct" or "hex" will be displayed in the output stream.
d. Octal numbers can appear in one of two ways.
What does the following statement do?
struct card a = {"Three", "Hearts"};
(a) It creates a variable card of type struct with two members specified in the list.
(b) It creates two variables named Three and Hearts of type struct card a.
(c) It creates a variable a to be of type struct card and initializes it to the values in the
list.
(d) It creates two variables named Three and Hearts of type struct card.
Which of the following is not specified by the following code segment:
page-pfa
for (c = 1; c <= 10; c++)
a) initial value of the loop counter
b) loop continuation test
c) increment of the loop counter
d) body statement of the loop
What does the \\ do when used in a format control string?
(a) It outputs the backslash character
(b) It delimits comments
(c) both a and b
(d) none of these
Q1: Select the correct statement regarding C++ I/O streams:
a. C++ provides only high-level I/O capabilities because it is a high-level programming
language.
b. High-level (formatted) I/O is best for large-volume transfers.
page-pfb
c. Low-level I/O breaks information down into small, meaningful groups of related
bytes.
d. Programmers generally prefer high-level I/O to low-level I/O.
Q3: Assume that t is an object of class Test, which has member functions a(), b(), c()
and d(). If the functions a(), b() and c() all return references to an object of class Test
(using the dereferenced this pointer) and function d() returns void, which of the
following statements will not produce a syntax error:
a. t.a().b().d();
b. a().b().t;
c. t.d().c();
d. t.a().t.d();
Every statement in C must end with a
(a) period (.)
(b) semicolon (;)
(c) colon (:)
(d) backslash (/)
page-pfc
Q1: Which of the following is correct keyword to explicitly indicate that a function
does not receive any parameters?
a.empty
b.void
c. epl
d. none
Enumeration constants within an enumeration
(a) must have unique integer values
(b) can be assigned other values once they have been defined
(c) must have unique identifiers
(d) are defined using the keyword const
page-pfd
Which statement about symbolic constants is true?
a) They make programs run faster.
b) They always make programs clearer.
c) They make it more difficult to modify programs.
d) Using meaningful names for symbolic constants helps make programs more
self-documenting.
A character constant is a(n) __________ value represented as a character in single
quotes.
a) short
b) int
c) long
d) double
Q1: Which of the following is true?
a. Only class templates may specify default type arguments for type parameters.
page-pfe
b. Only function templates may specify default type arguments for type parameters.
c. Both class templates and function templates may specify default type arguments for
type parameters.
d. None of the above.
Which statement about macros is true?
a) Macros always make programs run faster.
b) Macros cannot have arguments.
c) Macros cause text replacement at execution time.
d) Macro arguments should be enclosed in parentheses in the replacement text.
Which statement about function memcpy is false?
a) It copies a specified number of characters from the object pointed to by its second
argument into the object pointed to by its first argument.
b) It can receive a pointer to any type of object.
c) The result of this function is defined even if the two objects overlap in memory.
page-pff
d) Function memmove correctly handles the situation for which memcpy most notably
fails.
A(n) __________ is a location in the computer's memory where a value can be stored
for use by a program.
a) unknown
b) name
c) variable
d) declaration
Not returning dynamically allocated memory when it is no longer needed can cause a
system to run out of memory prematurely. This is called a(n) __________.
a) outage
b) memory hole
c) memory access violation
d) memory leak

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.