Q.1

Reference variables and const class member

  • must be assigned values in any derived class
  • must never be initialized in a base class
  • must be initialized, rather than assigned values
  • must not exit if a class is to be a base class
Q.2

_____ variables remain in memory until the statement block ends

  • Area
  • Global
  • Local
  • Reference
  • Value
Q.3

Which of the following statements is false?

  • A class encapsulates all of an object's attributes and behaviors
  • An example of an attribute is the minutes variable in a time class
  • An example of a behavior is the setTime function in a time class
  • A class is considered an object
  • An object created from a class is referred to as an instance of the class
Q.4

A function that is prototyped as double calculate(int num); may______

  • receive an integer constant such as 5
  • receive an integer variable
  • either (a) or (b)
  • neither (a) nor (b)
Q.5

If a base class member is private, then

  • if a derived class uses the public access specifier, the data member becomes public
  • if a derived class uses the protected access specifier, the data member becomes protected
  • both (a) and (b)
  • neither (a) nor (b)
Q.6

Assume you want to compare the character stored in the initial variable to the letter a. Which of the following conditions should you use in the if statement? (Be sure the condition will handle a or A.)

  • (initial = 'a' or 'A')
  • (initial == 'a' or 'A')
  • (toupper(initial) = 'A')
  • (toupper(initial) == 'A')
Q.7

Passing a variable pointer as a constant _____

  • protects the contents pointed to by the pointer from change
  • eliminates the need to name the pointer in the function
  • eliminates the need to give the pointer a type in the function
  • causes a copy of the pointer to be produced in the function
Q.8

Which of the following instructions tells C++ to merge the source code from the iostream.h file into the current file?

  • #include <iostream.h>
  • #include iostream.h
  • #include <iostream.h>
  • #merge iostream.h
  • None of the above
Q.9

You can override a class's inherited access to make an individual member's access more ______

  • liberal
  • conservative
  • either (a) or (b)
  • neither (a) nor (b)
Q.10

To hide a data member from the program, you must declare the data member in the _____ section of the class

  • concealed
  • confidential
  • hidden
  • private
  • restricted
Q.11

Library header files usually contain

  • complete functions
  • parts of functions
  • function prototypes for functions stored in other files
  • function bodies, but not function headers
Q.12

The C++ operator used to allocate memory is _________

  • mem
  • allocate
  • new
  • create
Q.13

Which of the following stream manipulators advances the cursor to the next line on the computer screen?

  • adin
  • advin
  • edlin
  • endl
  • lineadv
Q.14

With communicational cohesion

  • a tasks and the data are related
  • the tasks are related; the data are not
  • the data are related; the tasks are not
  • the tasks and the data are unrelated
Q.15

The delete operator returns ______ to the operating system

  • memory that is no longer needed
  • void
  • recycle bin
  • None of the above
Q.16

If an exception is thrown and no catch block matches the type of the thrown parameter, then _____

  • the program terminates
  • the first catch block is executed
  • the last catch block is executed
  • the program proceeds with the code following the catch blocks
Q.17

External documentation includes

  • a printout of the program's code
  • flowcharts
  • IPO charts
  • pseudocode
  • All of the above
Q.18

A C++ term meaning "generic" is

  • argument
  • parameterized
  • universal
  • global
Q.19

Assume that your version of C++ can recognize only the first 8 characters of an identifier name, through identifier names may be arbitrarily long. Which of the following identifier names is not distinct:

  • list, list2
  • address, Address
  • identifier_l, identifier_2
  • answer, ANSWER
  • None of the above
Q.20

6.5 is a _____ constant

  • character literal
  • named literal
  • numeric literal
  • string literal
Q.21

The function printDataMembers() is mot likely a(n) ________

  • inspector functions
  • mutator functions
  • auxiliary functions
  • manager functions
Q.22

The major advantage of data hiding is that _____

  • your programs can include more data
  • you no longer need functions
  • no one can ever use your data
  • your data will be used correctly
Q.23

The comma operator (,) is used to

  • permit two different expressions to appear in situations where only one expression would ordinarily be used
  • terminate loops or to exit from switch
  • alter the normal sequence of program execution by transferring control to some other part of the program
  • carry out a logical test and then take one of two possible actions, depending upon the outcome of the test
  • None of the above
Q.24

The instruction "If it's raining outside, then take an umbrella to work" is an example of the _____ structure

  • control
  • repetition
  • selection
  • sequence
  • switching
Q.25

A function that is called automatically each time an object is created is a(n)

  • constructor
  • contractor
  • builder
  • architect
Q.26

Before object-oriented exception handling was practiced, _____

  • no run-time errors occurred
  • programmers could not deal with run-time errors
  • the most popular error-handling method was to terminate the program
  • the most popular error-handling method was to throw an exception
Q.27

The String data type is an extension of the _____ data type

  • Character
  • Double
  • Letter
  • Long
  • Text
Q.28

When you define an object that is a member of a class, such as Student Abby; _____

  • a block of memory is set aside and all data members are assigned valid values
  • a block of memory is set aside
  • no memory is set aside until values are defined
  • no memory is set aside, but valid values are assigned to data members
Q.29

The break statement is

  • a preprocessor directive
  • an operator in the C++ language
  • a keyword in the C++ language
  • switch in the C++ language
  • None of the above
Q.30

You may override the class access specifier for_____

  • public members
  • public and protected members
  • any specific class members you choose
  • no clas smembers
Q.31

The comma operator (,) is primarily used in conjunction with

  • 'for' statement
  • 'if-else' statement
  • 'do-while' statement
  • All of the above
  • None of the above
Q.32

Object is to class as _____

  • library is to book
  • mother is to daughter
  • Plato is to philosopher
  • president is to Lincoln
Q.33

The time and memory involved in calling a function represent the function's _____

  • prototype
  • overhead
  • cost
  • burden
Q.34

The data type listed at the beginning of a value-returning function's header indicates the type of data the function will _____

  • return
  • pass
  • receive
Q.35

The letter V is a _____

  • character literal constant
  • numeric literal constant
  • string literal constant
  • variable
Q.36

A function that is called automatically each time an object is created is a(n)

  • constructor
  • contractor
  • builder
  • architect
Q.37

The functions go in the _____ section of a class definition

  • declaration
  • implementation
  • prototype
  • functioning
Q.38

Which of the following statements will assign the address of the age variable to the agePtr pointer?

  • agePtr = &age;
  • agePtr = *age;
  • &agePtr = age;
  • *agePtr = age;
  • agePtr -> *age;
Q.39

A variable's _____ indicates how long the variable remains in the computer's memory

  • area
  • extent
  • lifetime
  • reach
  • scope
Q.40

The preprocessor directive always ends with

  • a comma
  • a semicolon
  • neither a semicolon nor a comma
  • "/"
  • None of the above
Q.41

An advantage of using local variables is that _____

  • they are known to all functions in the file
  • names used in one function do not affect data stored in variables with the same names in other functions
  • values given to local variables are retained when those parameters go out of scope
  • the program does not become "crowded" with too many variable names
Q.42

A program can directly access the _____ members of a class

  • hidden
  • private
  • public
  • both (b) and (c)
Q.43

A variable w with a valuemay be defined with _______

  • int w = 67;
  • int w(67);
  • int 67(w);
  • both (a) and (b), but not (c).
Q.44

The null character needs a space of

  • zero bytes
  • one byte
  • three bytes
  • four bytes
  • None of the above
Q.45

To execute a C++ program, you first need to translate the source code into object code. This process is called

  • coding
  • compiling
  • sourcing
  • translating
Q.46

A derived class may also be called a

  • subclass
  • super class
  • parent class
  • base class
Q.47

Which function is most likely to have procedural cohesion?

  • main()
  • findSquareRoot()
  • getSaleSubtractDiscountAddTax()
  • openFiles()
Q.48

The code class Descendant : virtual public Ancestor indicates that

  • the members of Ancestor will be included more than once in Descendant
  • the members of Ancestor will be included only once in Descendant
  • the members of Descendant will be included more than once in Ancestor
  • the members of Descendant will be included only once in Ancestor
Q.49

When all of the operations in a function contribute to the performance of only one task, a function has

  • singular cohesion
  • tight cohesion
  • functional cohesion
  • sequential cohesion
Q.50

Separating parts of a program into units that remain unaffected by other parts of a program is the concept known as _____

  • intrusion
  • volatility
  • encapsulation
  • protection
0 h : 0 m : 1 s