COMPSCI 33277

subject Type Homework Help
subject Pages 9
subject Words 1442
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
Specifying the order in which statements are to be executed in a computer program is
called
(a) an algorithm
(b) transfer of control
(c) program control
(d) pseudocode
Function __________ searches for the first occurrence of a character in a string.
a) firstchar
b) getfirst
c) firstchr
d) strchr
Which of the following is not automatically opened when a C program begins?
a) standard error
b) standard output
page-pf2
c) standard dialog
d) standard input
Non-constant variables are also known as
(a) lvalues, but can be used as rvalues
(b) lvalues, and can not be used as rvalues
(c) rvalues, but can be used as lvalues
(d) constant variables
Which of the following is not one of the six logical units of a computer?
(a) input unit
(b) programmer unit
(c) memory unit
(d) output unit
page-pf3
Using an incorrect relational operator or using an incorrect final value of a loop counter
in the condition of a while or for statement is a frequent cause of __________errors.
a) syntax
b) compilation
c) off-by-one
d) divide-by-zero
In the statement
fseek (fPtr, (account " 1) * sizeof(struct clientData), SEEK_SET);
why are we adjusting account by "1?
a) Because the account numbers start at 0 and the file starts at position 0.
b) Because the account numbers start at 0 and the file starts at position 1.
c) Because the account numbers start at 1 and the file starts at position 0.
d) Because the account numbers start at 1 and the file starts at position 1.
page-pf4
A function that modifies an array by using pointer arithmetic to process every value
should have a parameter that is
(a) a nonconstant pointer to nonconstant data
(b) a nonconstant pointer to constant data
(c) a constant pointer to nonconstant data
(d) a constant pointer to constant data
Q5: When should base class members be declared protected?
a. When all clients should be able to access these members.
b. When these members are used only by member functions of this base class.
c. When these members should be available only to derived classes (and friends), but
not to other clients.
d. The protected access specified should never be used.
page-pf5
Q1: Select the false statement. If an exception is thrown from a constructor:
a. The object being constructed will not be constructed.
b. For an array, destructors for all array elements are called, even if those array
elements have not yet been constructed.
c. The exception can contain the error information that the constructor would not be
able to return in the normal manner.
d. For an object with member objects, and whose outer object has not been constructed,
the destructor is called for the member objects.
When memory allocated with malloc is no longer needed, return that memory to the
system immediately with __________.
a) free_memory
b) free_storage
c) return
d) free
Q1: An explicit constructor:
page-pf6
a. Cannot be called outside of the class it is declared in.
b. Can be implicitly called by the compiler to perform a data type conversion.
c. Does not initialize its class's data members.
d. Must take exactly one argument.
Q2: Which of the following is not an object of the ostream class?
a. cout
b. cerr
c. cin
d. clog
Which statement is false?
a) The result of shifting a value is undefined if the right operand is negative.
b) The result of shifting a value is undefined if the right operand has more bits than the
number of bits in which the left operand is stored.
c) Left shifting is machine dependent.
page-pf7
d) Right shifting is machine dependent.
A floating-point constant that's not suffixed is of type
(a) double
(b) float
(c) unsigned float
(d) long double
A bubble sort of 1000 elements requires a maximum of __________ passes.
a) 1001
b) 1000
c) 999
d) 998
page-pf8
In a printf, a backslash is printed by enclosing in quotes
a) \
b) \\
c) /\
d) //
In which of the following is y not equal to 5 after execution? Assume that x is equal to
4.
(a) y = 5;
(b) y = x++;
(c) y = ++x;
(d) y = x = 5;
page-pf9
In the context of counter-controlled iteration, which of the following is not
accomplished by the control-variable initialization statement?
int c = 10;
a) Names the control variable.
b) Defines the control variable to be an integer.
c) Specifies the sentinel value.
d) Sets the initial value of the control variable to 10.
Bohm and Jacopini's work demonstrated that all programs could be written in terms of
only three control statements, namely sequence, __________ and iteration.
a) selection
b) serialization
c) sorting
d) searching
A ________ is a group of characters or bytes that conveys meaning.
(a) database
page-pfa
(b) record
(c) character set
(d) field
Which statement is false?
a) Randomly accessed files are popular in transaction processing systems.
b) Data stored previously in a randomly accessed file can be updated or deleted without
rewriting the entire file.
c) Records of a randomly accessed file are normally fixed in length (i.e., all the record
in the file are the same length).
d) A record of a randomly accessed file is normally located by searching the portion of
that file which precedes that record.
Before a file can be accessed it must first be
a) copied
b) read
c) written
page-pfb
d) opened
Which statement is false?
a) Arrays and structures are aggregate data types.
b) Structures in C are sometimes called records in other languages.
c) A structure is capable of storing many related data items of different data types.
d) Structures are always passed call by reference.
Which statement is false?
a) Symbolic constants are constants represented as symbols.
b) Macros are operations defined as symbols.
c) All text replacement with symbolic constants and macros occurs before the program
is compiled.
d) Symbolic constants may be redefined with new values.
page-pfc
Q3: What type of member functions allow a client of a class to assign values to private
data members?
a. Client member functions.
b. Get member functions.
c. Set member functions.
d. None of the above.
Q3: Function templates:
a. Can include objects of template classes as parameters.
b. Must have return type T.
c. Do not need a separate template< typename type >statement if they take objects from
a template class as a parameter.
d. Do not need a separate template< typename type >statement.
page-pfd
Given the following definitions, what is the value of b[1][0]?
int b[2][2] = {{1}, {3, 4}};
(a) 0
(b) 1
(c) 3
(d) this isn"t a valid definition
__________ facilitate high-speed searching and sorting of data, efficient elimination of
duplicate items and compiling expressions into machine language.
a) Linked lists
b) Queues
c) Stacks
d) Binary Trees
Q1: The conventional way to distinguish between the overloaded preincrement and
postincrement operators (++) is:
a. To assign a dummy value to preincrement.
page-pfe
b. To make the argument list of postincrement include an int.
c. To have the postincrement operator call the preincrement operator.
d. Implicitly done by the compiler.
Pointers may be assigned which of the following?
(a) all integer values
(b) an address
(c) NULL
(d) both (b) and (c)

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.