Q.1

Which of the following are valid characters for a numeric literal constant?

  • a comma
  • a dollar sign ($)
  • a percent sign (%)
  • a space
  • None of the above
Q.2

Adding a derived class to a base class requires fundamental changes to the base class

  • True
  • False
Q.3

You _____ write your own container classes

  • must
  • may
  • should not
  • must not
Q.4

A static data member is given a value

  • within the class definition
  • outside the class definition
  • when the program is executed
  • never
Q.5

When a function includes a throw statement for errors, the call to the potentially offending function should be placed within a _____ block

  • throw
  • try
  • catch
  • scope
Q.6

When a child class function is called, the compiler looks first for a matching function name in the _____

  • class of the object using the function name
  • immediate ancestor class
  • base class
  • descendant class
Q.7

Which of the following while clause will stop the loop when the value in the age variable is less than the number 0?

  • while age < 0
  • while (age < 0)
  • while age >= 0;
  • while (age >= 0);
  • while (age >= 0)
Q.8

Redirection redirects

  • a stream from a file to the screen
  • a file from a device to a stream
  • a device from the screen to a file
  • the screen from a device to a stream
Q.9

If container classes are carefully constructed, then these tools are available to work with structures that are not ______

  • valid without container classes
  • programmer-defined
  • type-specific
  • public
Q.10

A group of related fields that contain all of the data about a specific person, place, or thing is called a

  • data file
  • field file
  • program file
  • record
Q.11

One way pointers are useful is to refer to a memory address that has no _____

  • name
  • constant
  • location
  • field
Q.12

A blueprint for creating an object in C++ is called _____

  • a class
  • an instance
  • a map
  • a pattern
  • a sketch
Q.13

When you pass a variable _____, C++ passes only the contents of the variable to the receiving function

  • by reference
  • by value
  • globally
  • locally
Q.14

A widget is to the blueprint for a widget as an object is to

  • a member function
  • a class
  • an operator
  • a data item
Q.15

An array name is a _____

  • subscript
  • formal parameter
  • memory address
  • prototype
Q.16

The first element in a string is

  • the name of the string
  • the first character in the string
  • the length of the string
  • the name of the array holding the string
Q.17

A function that changes the state of the cout object is called a(n) _____

  • member
  • adjuster
  • manipulator
  • operator
Q.18

Format flags may be combined using

  • the bitwise OR operator (|)
  • the logical OR operator (||)
  • the bitwise AND operator (&)
  • the logical AND operator (&&)
Q.19

If an integer object is thrown with a throw statement, then a subsequent catch block has a usable match if the type of the catch argument is

  • int
  • double
  • either (a) or (b)
  • neither (a) nor (b)
Q.20

You must provide a constructor for a derived class

  • always
  • if the base class constructor required arguments
  • if the base class constructor does not required arguments
  • never
Q.21

The scope resolution operator is

  • a comma
  • a semicolon
  • a colon
  • two colons
Q.22

A function that is called automatically each time an object is destroyed is a

  • constructor
  • destructor
  • destroyer
  • terminator
Q.23

The most efficient data type for a variable that stores the number 4.6eis the _____ data type

  • Character
  • Double
  • Float
  • Long Integer
  • Short Integer
Q.24

You mark the beginning of a function's block of code with the _____

  • /
  • *
  • {
  • }
  • either (c) or (d) can be used
Q.25

Header files often have the file extension _____

  • .H
  • .HE
  • .HEA
  • .HEAD
Q.26

C++ allows you to define the same functions more than once in the same program _____

  • if the definitions are identical
  • if the definitions are included in two separate #include files
  • if the definitions are located in a single #include file that is included more than once
  • C++ does not allow you to define the same functions more than once in the same program
Q.27

To enter a comment in a C++ program, you begin the comment with _____

  • **
  • &&
  • \\
  • @
  • //
Q.28

Variables declared outside a block are called _____

  • global
  • universal
  • stellar
  • external
Q.29

A C++ program contains a function with the header int function(double d, char c). Which of the following function headers could be used within the same program?

  • char function(double d, char c)
  • int function(int d, char c)
  • both (a) and (b)
  • neither (a) nor (b)
Q.30

The use of the break statement in a switch statement is

  • optional
  • compulsory
  • not allowed. It gives an error message
  • to check an error
  • None of the above
Q.31

The highest level of cohesion is

  • functional cohesion
  • temporal cohesion
  • logical cohesion
  • sequential cohesion
Q.32

If you want to override constructor default values for an object you are instantiating, you must also override

  • all other parameters to that constructor
  • all parameters to the left of that value
  • all parameters to the right of that value
  • no other parameters to that constructor
Q.33

"C++" is a _____ constant

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

Which of the following is a C++ object?

  • cin
  • >>
  • iostream
  • read()
Q.35

The compiler converts your C++ instructions into _____

  • edited code
  • object code
  • source code
  • translated code
Q.36

You separate a derived class name from its access specifier with

  • a colon
  • two colons
  • at least one space
  • a semicolon
Q.37

To use one of the C++ built-in mathematical functions, you must include the _____ header file in your program

  • calculation.h
  • compute.h
  • expression.h
  • math.h
  • mathematical.h
Q.38

In a C++ program, which of the following can be thrown?

  • scalar variables
  • programmer-defined objects
  • both (a) and (b)
  • neither (a) nor (b)
Q.39

A fundamental type such as int or double is a _____

  • programmer-defined type
  • complex type
  • nonscalar type
  • scalar type
Q.40

Files whose names end in .h are called _____ files

  • handy
  • header
  • helper
  • helping
Q.41

Functions that returns information about an object's state can be classified as ________

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

Which of the following calls a function named displayName, passing it no actual arguments?

  • call displayName;
  • call displayName ();
  • displayName;
  • displayName();
Q.43

The function whose prototype is Item getData(void); returns _____

  • the address of a structure
  • a copy of a structure
  • a pointer to a structure
  • nothing
Q.44

When accessing a structure member, the identifier to the left of the dot operator is the name of

  • a structure member
  • a structure tag
  • a structure variable
  • the keyword struct
Q.45

The name of a function ends with

  • double quotes
  • single quotes
  • parenthesis
  • #
  • None of the above
Q.46

An auxiliary function _____

  • return information about data members
  • changes the state of data members
  • performs an action or service
  • creates and destroys objects
Q.47

When using the standard files that come with the C++ compiler, you should surround the header file name with _____

  • square brackets
  • angle brackets
  • parentheses
  • quotes
Q.48

If you want only one memory location to be reserved for a class variable, no matter how many objects are instantiated, you should declare the variable as

  • static
  • unary
  • dynamic
  • volatile
Q.49

The feature that allows you to use the same function name for separate functions that have different argument lists is called _____

  • overriding
  • overloading
  • constructing
  • destructing
Q.50

Using new may result in less _____ memory than using an array

  • wasted
  • used
  • RAM
  • ROM
0 h : 0 m : 1 s